Skip to content

Commit

Permalink
Fix log level not applying
Browse files Browse the repository at this point in the history
The configured log level was set before the fern dispatch was applied, which seems to overwrite the previous log level.
Setting the log level to the configured one immediately after applying the dispatch fixes this.
  • Loading branch information
shuni64 committed Jan 31, 2020
1 parent 628f971 commit f2e8daf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ async fn main() -> Result<(), Error> {
} else {
Configuration::default()
};
log::set_max_level(config.logging.level);

let logging_colors = ColoredLevelConfig::new()
.debug(Color::BrightMagenta)
Expand Down Expand Up @@ -143,6 +142,7 @@ async fn main() -> Result<(), Error> {
}

dispatch.apply().expect("Couldn't start logger");
log::set_max_level(config.logging.level);

if let Some(init_matches) = matches.subcommand_matches("init") {
if config_path.exists() && !init_matches.is_present("force") {
Expand Down

0 comments on commit f2e8daf

Please sign in to comment.