mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
@@ -0,0 +1,19 @@
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
use super::{super::fmt, Closure};
|
||||
|
||||
pub fn to_html<S>(out: &Arc<Mutex<S>>) -> Box<Closure>
|
||||
where
|
||||
S: std::fmt::Write + Send + 'static,
|
||||
{
|
||||
let out = out.clone();
|
||||
Box::new(move |data| {
|
||||
fmt::html(
|
||||
&mut *out.lock().expect("locked"),
|
||||
&data.level(),
|
||||
data.span_name(),
|
||||
data.message(),
|
||||
)
|
||||
.expect("log line appended");
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user