Skip to content
Snippets Groups Projects
Commit 1bb4021b authored by Jason Volk's avatar Jason Volk
Browse files

add format util to log suite


Signed-off-by: default avatarJason Volk <jason@zemos.net>
parent 877c04de
No related branches found
No related tags found
1 merge request!439Tracing Capture
use std::fmt::Write;
use super::{color, Level};
use crate::Result;
pub fn html<S>(out: &mut S, level: &Level, span: &str, msg: &str) -> Result<()>
where
S: Write,
{
let color = color::code_tag(level);
let level = level.as_str().to_uppercase();
write!(
out,
"<font data-mx-color=\"{color}\"><code>{level:>5}</code></font> <code>{span:<12}</code> <code>{msg}</code><br>"
)?;
Ok(())
}
pub mod color;
pub mod fmt;
mod reload;
pub use reload::ReloadHandle;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment