Skip to content

Commit

Permalink
Merge pull request iopsystems#13 from brayniac/logging
Browse files Browse the repository at this point in the history
logging: fix interaction between config and cli args
  • Loading branch information
brayniac authored Aug 20, 2019
2 parents 5e8df38 + 2bfafd0 commit f5bae8d
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,15 @@ impl Config {
Default::default()
};

config
.general
.set_logging(match matches.occurrences_of("verbose") {
0 => Level::Info,
1 => Level::Debug,
_ => Level::Trace,
});
match matches.occurrences_of("verbose") {
0 => {} // don't do anything, default is Info
1 => {
if config.general.logging() == Level::Info {
config.general.set_logging(Level::Debug);
}
}
_ => config.general.set_logging(Level::Trace),
}

config
}
Expand Down

0 comments on commit f5bae8d

Please sign in to comment.