From 0c970263cea8b3ac26e2202219f5a53b302598d4 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Tue, 12 Apr 2016 22:27:57 +0200 Subject: [PATCH] Add debugging output in handle_external_linking() --- imag-link/src/main.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/imag-link/src/main.rs b/imag-link/src/main.rs index 1f0a7205..bd8d7f21 100644 --- a/imag-link/src/main.rs +++ b/imag-link/src/main.rs @@ -194,21 +194,25 @@ fn handle_external_linking(rt: &Runtime) { let mut entry = entry.unwrap(); if scmd.is_present("add") { + debug!("Adding link to entry!"); add_link_to_entry(rt.store(), scmd, &mut entry); return; } if scmd.is_present("remove") { + debug!("Removing link from entry!"); remove_link_from_entry(rt.store(), scmd, &mut entry); return; } if scmd.is_present("set") { + debug!("Setting links in entry!"); set_links_for_entry(rt.store(), scmd, &mut entry); return; } if scmd.is_present("list") { + debug!("Listing links in entry!"); list_links_for_entry(rt.store(), &mut entry); return; } @@ -221,14 +225,18 @@ fn add_link_to_entry(store: &Store, matches: &ArgMatches, entry: &mut FileLockEn let link = Url::parse(link); if link.is_err() { + debug!("URL parsing error..."); trace_error(&link.err().unwrap()); + debug!("Exiting"); exit(1); } let link = link.unwrap(); if let Err(e) = entry.add_external_link(store, link) { + debug!("Error while adding external link..."); trace_error(&e); } else { + debug!("Everything worked well"); info!("Ok"); } }