use loglet::{Level, log, log_tagged};
use owo_colors::Style;
const WTF: Level = Level::new(
"WTF",
Style::new().magenta().bold().underline(),
Style::new().magenta(),
true );
fn main() {
println!("--- Custom Level Demonstration --- \n");
let component = "AuthService";
let unexpected_value = 404;
println!("-- Normal calls --");
log(
WTF,
format_args!("Received status code {} inside the {}! This shouldn't be physically possible.", unexpected_value, component)
);
log_tagged(
WTF,
Some(&component),
format_args!("Received status code {} inside the {}! This shouldn't be physically possible.", unexpected_value, component)
);
println!("\n -- Direct calls -- ");
WTF.print(format_args!("Something went critically wrong!"));
WTF.print_tagged(Some(&component), format_args!("Something went critically wrong!"));
}