1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
use colored::*; pub fn warn(message: &str) { println!("[{}] {}", "WARN".yellow().bold(), message) } pub fn error<E: std::fmt::Debug>(message: &str, err: E) { println!( "[{}] {} {:?}", "ERROR".white().on_red().bold(), message, err ) } // TODO: write a custom macro and wrap the default `dbg!()` behaviour.