summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2018-04-15 09:35:10 +0200
committerGitHub <noreply@github.com>2018-04-15 09:35:10 +0200
commit877f0dfb6b71d2b816b1d21d17e1c71497fcf32e (patch)
tree03a1093827a6e4efc772fb604cc327a14827cced
parent90eb83a538885d8ea548e2f9d6842528d7164cf0 (diff)
parent0f19b7e4b2a87fc0b426221619aac956c751b14d (diff)
downloadimag-877f0dfb6b71d2b816b1d21d17e1c71497fcf32e.zip
imag-877f0dfb6b71d2b816b1d21d17e1c71497fcf32e.tar.gz
Merge pull request #1401 from matthiasbeyer/libimagrt/logging-level-fix
Fix log level setting in runtime
-rw-r--r--lib/core/libimagrt/src/logger.rs10
-rw-r--r--lib/core/libimagrt/src/runtime.rs1
2 files changed, 6 insertions, 5 deletions
diff --git a/lib/core/libimagrt/src/logger.rs b/lib/core/libimagrt/src/logger.rs
index ec00a2e..8d5d2e4 100644
--- a/lib/core/libimagrt/src/logger.rs
+++ b/lib/core/libimagrt/src/logger.rs
@@ -231,13 +231,13 @@ fn aggregate_global_loglevel(matches: &ArgMatches, config: Option<&Value>) -> Re
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()) {
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)
+ },
}
}
diff --git a/lib/core/libimagrt/src/runtime.rs b/lib/core/libimagrt/src/runtime.rs
index a51fe8c..2aa091e 100644
--- a/lib/core/libimagrt/src/runtime.rs
+++ b/lib/core/libimagrt/src/runtime.rs
@@ -185,6 +185,7 @@ impl<'a> Runtime<'a> {
.required(false)
.takes_value(true)
.possible_values(&["trace", "debug", "info", "warn", "error"])
+ .default_value("info")
.value_name("LOGLEVEL"))
.arg(Arg::with_name(Runtime::arg_debugging_name())