mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-29 01:13:53 +03:00
make some logs show up more noticeably
This commit is contained in:
parent
2e8cd7ff7a
commit
c3ec2c9dd9
@ -1,4 +1,4 @@
|
||||
use log::{Log, Metadata, Record};
|
||||
use log::{Level, Log, Metadata, Record};
|
||||
use yansi::Paint;
|
||||
|
||||
pub struct LogAdapter;
|
||||
@ -18,7 +18,10 @@ impl Log for LogAdapter {
|
||||
pub fn format_log_record(record: &Record) -> String {
|
||||
format!(
|
||||
"[{}] [{}] {}",
|
||||
Paint::white(record.level()),
|
||||
match record.level() {
|
||||
Level::Error | Level::Warn => Paint::red(record.level()),
|
||||
_ => Paint::white(record.level()),
|
||||
},
|
||||
match record.target() {
|
||||
"UI" => Paint::red("UI"),
|
||||
"sim" => Paint::green("sim"),
|
||||
|
Loading…
Reference in New Issue
Block a user