summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2018-04-30 15:47:58 +0200
committerMatthias Beyer <mail@beyermatthias.de>2018-05-01 22:29:46 +0200
commitb27b392f4b8a618eb4b295e3138c4fdd34e4daec (patch)
treee378d6c5f644c2baa52eb8eb5f72586f9002d544 /lib
parent9f99783c6ebd3088189e0e0c2848e040bc4cc33c (diff)
Add trace output
Diffstat (limited to 'lib')
-rw-r--r--lib/core/libimagstore/src/file_abstraction/fs.rs1
-rw-r--r--lib/core/libimagstore/src/store.rs4
2 files changed, 5 insertions, 0 deletions
diff --git a/lib/core/libimagstore/src/file_abstraction/fs.rs b/lib/core/libimagstore/src/file_abstraction/fs.rs
index 8ee7ee9d..42314502 100644
--- a/lib/core/libimagstore/src/file_abstraction/fs.rs
+++ b/lib/core/libimagstore/src/file_abstraction/fs.rs
@@ -96,6 +96,7 @@ impl FileAbstractionInstance for FSFileAbstractionInstance {
};
*self = FSFileAbstractionInstance::File(file, path);
if let FSFileAbstractionInstance::File(ref mut f, _) = *self {
+ trace!("Writing buffer...");
return f.write_all(&buf).chain_err(|| SEK::FileNotWritten);
}
unreachable!();
diff --git a/lib/core/libimagstore/src/store.rs b/lib/core/libimagstore/src/store.rs
index 44afbea6..cefa42d7 100644
--- a/lib/core/libimagstore/src/store.rs
+++ b/lib/core/libimagstore/src/store.rs
@@ -177,6 +177,7 @@ impl StoreEntry {
fn write_entry(&mut self, entry: &Entry) -> Result<()> {
if self.is_borrowed() {
assert_eq!(self.id, entry.location);
+ trace!("Writing entry...");
self.file
.write_file_content(entry)
.map(|_| ())
@@ -442,11 +443,13 @@ impl Store {
debug!("Writing Entry");
se.write_entry(&entry.entry)?;
+ trace!("Entry written");
if modify_presence {
debug!("Modifying presence of {} -> Present", entry.get_location());
se.status = StoreEntryStatus::Present;
}
+ trace!("Entry updated successfully");
Ok(())
}
@@ -798,6 +801,7 @@ impl<'a> Drop for FileLockEntry<'a> {
use libimagerror::trace::trace_error_dbg;
trace!("Dropping: {:?} - from FileLockEntry::drop()", self.get_location());
if let Err(e) = self.store._update(self, true) {
+ trace!("Error happened in FileLockEntry::drop() while Store::update()ing");
trace_error_dbg(&e);
if_cfg_panic!("ERROR WHILE DROPPING: {:?}", e);
}