From c4584bf1ca1fa4b8bf296995eade307e3df6eb26 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sun, 4 Jun 2017 16:59:23 +0200 Subject: [PATCH] Add debug output in Store::create() --- libimagstore/src/store.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libimagstore/src/store.rs b/libimagstore/src/store.rs index 4d7e811d..be0ad79e 100644 --- a/libimagstore/src/store.rs +++ b/libimagstore/src/store.rs @@ -333,6 +333,8 @@ impl Store { pub fn create<'a, S: IntoStoreId>(&'a self, id: S) -> Result> { let id = try!(id.into_storeid()).with_base(self.path().clone()); + debug!("Creating id: '{}'", id); + { let mut hsmap = match self.entries.write() { Err(_) => return Err(SEK::LockPoisoned.into_error()).map_err_into(SEK::CreateCallError), @@ -340,15 +342,19 @@ impl Store { }; if hsmap.contains_key(&id) { + debug!("Cannot create, internal cache already contains: '{}'", id); return Err(SEK::EntryAlreadyExists.into_error()).map_err_into(SEK::CreateCallError); } hsmap.insert(id.clone(), { + debug!("Creating: '{}'", id); let mut se = try!(StoreEntry::new(id.clone())); se.status = StoreEntryStatus::Borrowed; se }); } + debug!("Constructing FileLockEntry: '{}'", id); + Ok(FileLockEntry::new(self, Entry::new(id))) }