diff options
author | Lars Wirzenius <liw@liw.fi> | 2017-06-24 17:26:58 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2017-06-24 17:26:58 +0300 |
commit | 1d1d2fcfbf2af0e0738073898f91de03e3fccf28 (patch) | |
tree | 437423ec47006dcf675ce739109312bd1917b416 /obnamlib/fmt_ga/leaf_store.py | |
parent | d9bdb11d7d89945b2e43d54e8e4ed6e2a4b172ee (diff) | |
download | obnam-1d1d2fcfbf2af0e0738073898f91de03e3fccf28.tar.gz |
Add: trace statements for leaf put/get/remove
Diffstat (limited to 'obnamlib/fmt_ga/leaf_store.py')
-rw-r--r-- | obnamlib/fmt_ga/leaf_store.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/obnamlib/fmt_ga/leaf_store.py b/obnamlib/fmt_ga/leaf_store.py index 56b08faa..7ba0f48a 100644 --- a/obnamlib/fmt_ga/leaf_store.py +++ b/obnamlib/fmt_ga/leaf_store.py @@ -16,6 +16,9 @@ # =*= License: GPL-3+ =*= +import tracing + + import obnamlib @@ -65,14 +68,18 @@ class LeafStore(LeafStoreInterface): # pragma: no cover self._blob_store = blob_store def put_leaf(self, leaf): - return self._blob_store.put_blob(leaf.as_dict()) + leaf_id = self._blob_store.put_blob(leaf.as_dict()) + tracing.trace('new leaf %s', leaf_id) + return leaf_id def get_leaf(self, leaf_id): + tracing.trace('leaf_id %s', leaf_id) leaf = obnamlib.CowLeaf() leaf.from_dict(self._blob_store.get_blob(leaf_id)) return leaf def remove_leaf(self, leaf_id): + tracing.trace('leaf_id %s', leaf_id) # FIXME: This is a bit ugly, since we need to break the # bag/blob store abstraction. bag_id, _ = obnamlib.parse_object_id(leaf_id) |