From 1d1d2fcfbf2af0e0738073898f91de03e3fccf28 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sat, 24 Jun 2017 17:26:58 +0300 Subject: Add: trace statements for leaf put/get/remove --- obnamlib/fmt_ga/leaf_store.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'obnamlib/fmt_ga/leaf_store.py') 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) -- cgit v1.2.1