mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
aa34021b27
Signed-off-by: Jason Volk <jason@zemos.net>
19 lines
395 B
Rust
19 lines
395 B
Rust
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(())
|
|
}
|