Merge pull request #1401 from matthiasbeyer/libimagrt/logging-level-fix
Fix log level setting in runtime
This commit is contained in:
commit
877f0dfb6b
2 changed files with 6 additions and 5 deletions
|
@ -231,13 +231,13 @@ fn aggregate_global_loglevel(matches: &ArgMatches, config: Option<&Value>) -> Re
|
||||||
return Ok(Some(Level::Debug))
|
return Ok(Some(Level::Debug))
|
||||||
}
|
}
|
||||||
|
|
||||||
if matches.is_present(Runtime::arg_verbosity_name()) {
|
|
||||||
return Ok(Some(Level::Info))
|
|
||||||
}
|
|
||||||
|
|
||||||
match matches.value_of(Runtime::arg_verbosity_name()) {
|
match matches.value_of(Runtime::arg_verbosity_name()) {
|
||||||
Some(v) => match_log_level_str(v).map(Some),
|
Some(v) => match_log_level_str(v).map(Some),
|
||||||
None => Ok(None),
|
None => if matches.is_present(Runtime::arg_verbosity_name()) {
|
||||||
|
Ok(Some(Level::Info))
|
||||||
|
} else {
|
||||||
|
Ok(None)
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -185,6 +185,7 @@ impl<'a> Runtime<'a> {
|
||||||
.required(false)
|
.required(false)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.possible_values(&["trace", "debug", "info", "warn", "error"])
|
.possible_values(&["trace", "debug", "info", "warn", "error"])
|
||||||
|
.default_value("info")
|
||||||
.value_name("LOGLEVEL"))
|
.value_name("LOGLEVEL"))
|
||||||
|
|
||||||
.arg(Arg::with_name(Runtime::arg_debugging_name())
|
.arg(Arg::with_name(Runtime::arg_debugging_name())
|
||||||
|
|
Loading…
Reference in a new issue