Skip to content

Commit

Permalink
correctly set global max log level
Browse files Browse the repository at this point in the history
  • Loading branch information
djugei committed Dec 29, 2024
1 parent 737c444 commit 70627a7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ fn main() {
let logger = pretty_env_logger::formatted_builder()
.parse_default_env()
.build();
let level = logger.filter();

let multi = MultiProgress::new();
let sty_main = ProgressStyle::with_template("{bar:40.green/yellow} {pos:>4}/{len:4}")
Expand All @@ -62,6 +63,7 @@ fn main() {
let sty_aux_encode = ProgressStyle::with_template("{spinner:.green} {msg}").unwrap();

LogWrapper::new(multi.clone(), logger).try_init().unwrap();
log::set_max_level(level);

let matches = cli().get_matches_from(
#[cfg(not(windows))]
Expand Down

0 comments on commit 70627a7

Please sign in to comment.