_level wasn't necessary

master
rasul 5 years ago
parent 4139361644
commit dc2dfc4bbc

@ -52,27 +52,18 @@ impl Log for Logger {
let now = chrono::Local::now(); let now = chrono::Local::now();
let ts = now.format("%Y-%m-%dT%H:%M:%S%.3f%z").to_string(); let ts = now.format("%Y-%m-%dT%H:%M:%S%.3f%z").to_string();
let (msg, _level) = match record.level() { let msg = match record.level() {
Level::Error => ( Level::Error => format!("{} {} {}", ts.white().bold(), "ERR".red(), record.args()),
format!("{} {} {}", ts.white().bold(), "ERR".red(), record.args()), Level::Warn => {
3, format!("{} {} {}", ts.white().bold(), "WRN".purple(), record.args())
), }
Level::Warn => ( Level::Info => format!("{} {} {}", ts.white().bold(), "INF".cyan(), record.args()),
format!("{} {} {}", ts.white().bold(), "WRN".purple(), record.args()), Level::Debug => {
4, format!("{} {} {}", ts.white().bold(), "DBG".yellow(), record.args())
), }
Level::Info => ( Level::Trace => {
format!("{} {} {}", ts.white().bold(), "INF".cyan(), record.args()), format!("{} {} {}", ts.white().bold(), "TRC".green(), record.args())
6, }
),
Level::Debug => (
format!("{} {} {}", ts.white().bold(), "DBG".yellow(), record.args()),
7,
),
Level::Trace => (
format!("{} {} {}", ts.white().bold(), "TRC".green(), record.args()),
0,
),
}; };
println!("{}", msg); println!("{}", msg);
} }

Loading…
Cancel
Save