From: Brian Warner Date: Wed, 19 Dec 2007 06:30:50 +0000 (-0700) Subject: mutable.Publish: improve logging X-Git-Url: https://git.rkrishnan.org/%5B/%5D%20/uri/flags/quickstart.html?a=commitdiff_plain;h=c00b88025dcbea932b1d755cd1409ec490f83e65;p=tahoe-lafs%2Ftahoe-lafs.git mutable.Publish: improve logging --- diff --git a/src/allmydata/mutable.py b/src/allmydata/mutable.py index 8fde8981..6743ee4e 100644 --- a/src/allmydata/mutable.py +++ b/src/allmydata/mutable.py @@ -711,7 +711,7 @@ class Publish: self._node = filenode self._storage_index = self._node.get_storage_index() self._log_prefix = prefix = idlib.b2a(self._storage_index)[:6] - num = self._node._client.log("Publish(%s): starting") + num = self._node._client.log("Publish(%s): starting", prefix) self._log_number = num def log(self, msg): @@ -852,11 +852,14 @@ class Publish: def _got_query_results(self, datavs, peerid, permutedid, reachable_peers, current_share_peers): - self.log("_got_query_results from %s" % idlib.shortnodeid_b2a(peerid)) + lp = self.log("_got_query_results from %s" % + idlib.shortnodeid_b2a(peerid)) assert isinstance(datavs, dict) reachable_peers[peerid] = permutedid + if not datavs: + self.log("peer has no shares", parent=lp) for shnum, datav in datavs.items(): - self.log(" peer has shnum %d" % shnum) + self.log("peer has shnum %d" % shnum, parent=lp) assert len(datav) == 1 data = datav[0] # We want (seqnum, root_hash, IV) from all servers to know what @@ -876,7 +879,8 @@ class Publish: valid = self._pubkey.verify(prefix, signature) if not valid: self.log("WEIRD: bad signature from %s shnum %d" % - (shnum, idlib.shortnodeid_b2a(peerid))) + (shnum, idlib.shortnodeid_b2a(peerid)), + parent=lp) continue share = (shnum, seqnum, root_hash)