_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 ts = now.format("%Y-%m-%dT%H:%M:%S%.3f%z").to_string();
let (msg, _level) = match record.level() {
Level::Error => (
format!("{} {} {}", ts.white().bold(), "ERR".red(), record.args()),
3,
),
Level::Warn => (
format!("{} {} {}", ts.white().bold(), "WRN".purple(), record.args()),
4,
),
Level::Info => (
format!("{} {} {}", ts.white().bold(), "INF".cyan(), 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,
),
let msg = match record.level() {
Level::Error => format!("{} {} {}", ts.white().bold(), "ERR".red(), record.args()),
Level::Warn => {
format!("{} {} {}", ts.white().bold(), "WRN".purple(), record.args())
}
Level::Info => format!("{} {} {}", ts.white().bold(), "INF".cyan(), record.args()),
Level::Debug => {
format!("{} {} {}", ts.white().bold(), "DBG".yellow(), record.args())
}
Level::Trace => {
format!("{} {} {}", ts.white().bold(), "TRC".green(), record.args())
}
};
println!("{}", msg);
}

Loading…
Cancel
Save