diff options
Diffstat (limited to 'bin/domain/imag-todo/src')
-rw-r--r-- | bin/domain/imag-todo/src/lib.rs | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/bin/domain/imag-todo/src/lib.rs b/bin/domain/imag-todo/src/lib.rs index cc17a1db..42f9baeb 100644 --- a/bin/domain/imag-todo/src/lib.rs +++ b/bin/domain/imag-todo/src/lib.rs @@ -254,6 +254,8 @@ fn list_todos(rt: &Runtime, matcher: &StatusMatcher, show_hidden: bool) -> Resul { use libimagentryview::error::Error as E; + trace!("Viewing entry: {}", entry.get_location()); + if !entry.is_todo().map_err(E::from)? { return Err(format_err!("Not a Todo: {}", entry.get_location())).map_err(E::from); } @@ -267,10 +269,12 @@ fn list_todos(rt: &Runtime, matcher: &StatusMatcher, show_hidden: bool) -> Resul .unwrap_or("<empty description>"); if !self.details { - writeln!(sink, "{uuid} - {status} : {first_line}", + let r = writeln!(sink, "{uuid} - {status} : {first_line}", uuid = uuid, status = status, - first_line = first_line) + first_line = first_line); + trace!("Viewing entry result: {:?}", r); + r } else { let sched = util::get_dt_str(entry.get_scheduled(), "Not scheduled")?; let hidden = util::get_dt_str(entry.get_hidden(), "Not hidden")?; @@ -278,14 +282,17 @@ fn list_todos(rt: &Runtime, matcher: &StatusMatcher, show_hidden: bool) -> Resul let priority = entry.get_priority().map_err(E::from)?.map(|p| p.as_str().to_string()) .unwrap_or_else(|| "No prio".to_string()); - writeln!(sink, "{uuid} - {status} - {sched} - {hidden} - {due} - {prio}: {first_line}", + let r = writeln!(sink, "{uuid} - {status} - {sched} - {hidden} - {due} - {prio}: {first_line}", uuid = uuid, status = status, sched = sched, hidden = hidden, due = due, prio = priority, - first_line = first_line) + first_line = first_line); + + trace!("Viewing entry result: {:?}", r); + r } .map_err(libimagentryview::error::Error::from) } |