Fix for latest env_logger
This commit is contained in:
parent
2d43d10730
commit
91ad402f52
1 changed files with 8 additions and 5 deletions
13
src/main.rs
13
src/main.rs
|
|
@ -178,11 +178,14 @@ fn parse_opts_into_struct(
|
|||
env_logger::builder()
|
||||
.filter_module(module_path!(), log_level)
|
||||
.format(|buf, record| {
|
||||
let style = match record.level() {
|
||||
Level::Error | Level::Warn => buf.default_level_style(record.level()),
|
||||
_ => buf.style(), // Leave info, debug and trace unstyled
|
||||
};
|
||||
writeln!(buf, "{}", style.value(record.args()))
|
||||
match record.level() {
|
||||
Level::Error | Level::Warn => {
|
||||
let style = buf.default_level_style(record.level());
|
||||
writeln!(buf, "{style}{}{style:#}", record.args())
|
||||
}
|
||||
// Leave info, debug and trace unstyled
|
||||
_ => writeln!(buf, "{}", record.args()),
|
||||
}
|
||||
})
|
||||
.init();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue