From 51650bf043cfeb56acca1dda52517033af23a900 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 4 Sep 2017 16:24:50 +0200 Subject: [PATCH] Small embellishments Fix false documentation, make warn!() into error!() and provide more information in the logged message. --- bin/domain/imag-todo/src/main.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bin/domain/imag-todo/src/main.rs b/bin/domain/imag-todo/src/main.rs index 223926c6..20ad60e4 100644 --- a/bin/domain/imag-todo/src/main.rs +++ b/bin/domain/imag-todo/src/main.rs @@ -61,7 +61,9 @@ fn tw_hook(rt: &Runtime) { let subcmd = rt.cli().subcommand_matches("tw-hook").unwrap(); if subcmd.is_present("add") { let stdin = stdin(); - let stdin = stdin.lock(); // implements BufRead which is required for `FileLockEntry::import_task_from_reader()` + + // implements BufRead which is required for `Store::import_task_from_reader()` + let stdin = stdin.lock(); match rt.store().import_task_from_reader(stdin) { Ok((_, line, uuid)) => println!("{}\nTask {} stored in imag", line, uuid), @@ -101,11 +103,12 @@ fn list(rt: &Runtime) { match fle.get_header().read(&String::from("todo.uuid")) { Ok(Some(&Value::String(ref u))) => Some(u.clone()), Ok(Some(_)) => { - warn!("Header type error"); + error!("Header type error, expected String at 'todo.uuid' in {}", + fle.get_location()); None }, Ok(None) => { - warn!("Header missing field"); + error!("Header missing field in {}", fle.get_location()); None }, Err(e) => {