Use libimagrt logging

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
Matthias Beyer 2018-10-31 23:05:58 +01:00
parent 59f16d0eab
commit e4ffeddf85
2 changed files with 12 additions and 1 deletions

View file

@ -33,7 +33,6 @@ log = "0.4.0"
toml = "0.4" toml = "0.4"
toml-query = "0.7" toml-query = "0.7"
libimagrt = { version = "0.9.0", path = "../../../lib/core/libimagrt" }
libimagerror = { version = "0.9.0", path = "../../../lib/core/libimagerror" } libimagerror = { version = "0.9.0", path = "../../../lib/core/libimagerror" }
[dependencies.clap] [dependencies.clap]
@ -41,3 +40,8 @@ version = "^2.29"
default-features = false default-features = false
features = ["suggestions", "color", "wrap_help"] features = ["suggestions", "color", "wrap_help"]
[dependencies.libimagrt]
version = "0.9.0"
path = "../../../lib/core/libimagrt"
features = ["pub_logging_initialization"]

View file

@ -60,6 +60,7 @@ use libimagrt::spec::CliSpec;
use libimagerror::io::ToExitCode; use libimagerror::io::ToExitCode;
use libimagerror::exit::ExitUnwrap; use libimagerror::exit::ExitUnwrap;
use libimagerror::trace::trace_error; use libimagerror::trace::trace_error;
use libimagrt::configuration::InternalConfiguration;
/// Returns the helptext, putting the Strings in cmds as possible /// Returns the helptext, putting the Strings in cmds as possible
/// subcommands into it /// subcommands into it
@ -182,7 +183,9 @@ fn main() {
} }
} }
let enable_logging = app.enable_logging();
let matches = app.matches(); let matches = app.matches();
let rtp = ::libimagrt::runtime::get_rtp_match(&matches); let rtp = ::libimagrt::runtime::get_rtp_match(&matches);
let configpath = matches let configpath = matches
.value_of(Runtime::arg_config_name()) .value_of(Runtime::arg_config_name())
@ -194,6 +197,10 @@ fn main() {
exit(1) exit(1)
}); });
if enable_logging {
Runtime::init_logger(&matches, config.as_ref())
}
debug!("matches: {:?}", matches); debug!("matches: {:?}", matches);
// Begin checking for arguments // Begin checking for arguments