From 22be304a3ad0cf9bf4743a9c08b16de5dcba9bcd Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Tue, 5 Jan 2016 16:21:49 +0100 Subject: [PATCH] Use return value: ImagLogger::init() -> fail if init failed --- src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index d0a4d92d..1642dcdc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -37,13 +37,17 @@ pub use module::bm::BM; pub use module::notes::Notes; fn main() { + use std::process::exit; use ansi_term::Colour::Yellow; let yaml = load_yaml!("../etc/cli.yml"); let app = App::from_yaml(yaml); 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);