ImagLogger can be configured through the CLI only now
This commit is contained in:
parent
bbcf0e2dba
commit
745f57e480
2 changed files with 6 additions and 4 deletions
|
@ -29,8 +29,10 @@ fn main() {
|
||||||
let yaml = load_yaml!("../etc/cli.yml");
|
let yaml = load_yaml!("../etc/cli.yml");
|
||||||
let app = App::from_yaml(yaml);
|
let app = App::from_yaml(yaml);
|
||||||
let config = CliConfig::new(app);
|
let config = CliConfig::new(app);
|
||||||
|
|
||||||
|
ImagLogger::init(&config);
|
||||||
|
|
||||||
let configuration = Configuration::new(&config);
|
let configuration = Configuration::new(&config);
|
||||||
ImagLogger::init(&configuration, &config);
|
|
||||||
|
|
||||||
debug!("Logger created!");
|
debug!("Logger created!");
|
||||||
debug!("CliConfig : {:?}", &config);
|
debug!("CliConfig : {:?}", &config);
|
||||||
|
|
|
@ -20,10 +20,10 @@ impl ImagLogger {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn init(cfg: &Cfg, config: &CliConfig) -> Result<(), SetLoggerError> {
|
pub fn init(config: &CliConfig) -> Result<(), SetLoggerError> {
|
||||||
let lvl = if config.is_debugging() || cfg.is_debugging() {
|
let lvl = if config.is_debugging() {
|
||||||
LogLevelFilter::Debug
|
LogLevelFilter::Debug
|
||||||
} else if config.is_verbose() || cfg.is_debugging() {
|
} else if config.is_verbose() {
|
||||||
LogLevelFilter::Info
|
LogLevelFilter::Info
|
||||||
} else {
|
} else {
|
||||||
LogLevelFilter::Error
|
LogLevelFilter::Error
|
||||||
|
|
Loading…
Reference in a new issue