add markdown log format for capture
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
c914a4fd91
commit
1f9225e4d1
6 changed files with 95 additions and 17 deletions
|
@ -16,3 +16,32 @@ where
|
|||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn markdown<S>(out: &mut S, level: &Level, span: &str, msg: &str) -> Result<()>
|
||||
where
|
||||
S: Write,
|
||||
{
|
||||
let level = level.as_str().to_uppercase();
|
||||
writeln!(out, "`{level:>5}` `{span:^12}` `{msg}`")?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn markdown_table<S>(out: &mut S, level: &Level, span: &str, msg: &str) -> Result<()>
|
||||
where
|
||||
S: Write,
|
||||
{
|
||||
let level = level.as_str().to_uppercase();
|
||||
writeln!(out, "| `{level:>5}` | `{span:^12}` | `{msg} |")?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn markdown_table_head<S>(out: &mut S) -> Result<()>
|
||||
where
|
||||
S: Write,
|
||||
{
|
||||
write!(out, "| level | span | message |\n|------:|:----:|:--------|\n")?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue