Use return value: ImagLogger::init() -> fail if init failed

This commit is contained in:
Matthias Beyer 2016-01-05 16:21:49 +01:00
parent b772b34837
commit 22be304a3a

View file

@ -37,13 +37,17 @@ pub use module::bm::BM;
pub use module::notes::Notes; pub use module::notes::Notes;
fn main() { fn main() {
use std::process::exit;
use ansi_term::Colour::Yellow; use ansi_term::Colour::Yellow;
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); ImagLogger::init(&config).map_err(|e| {
error!("Could not initialize logger");
exit(1);
}).ok();
let configuration = Configuration::new(&config); let configuration = Configuration::new(&config);