From eedef54a72bc09b7c91f63cff42b9c2e887b5fe6 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Sun, 3 Dec 2006 00:53:53 -0700 Subject: [PATCH] add more logging --- allmydata/queen.py | 6 ++++-- allmydata/upload.py | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/allmydata/queen.py b/allmydata/queen.py index 2f50c300..f8720412 100644 --- a/allmydata/queen.py +++ b/allmydata/queen.py @@ -20,17 +20,19 @@ class Roster(service.MultiService, Referenceable): def remote_hello(self, nodeid, node, pburl): log.msg("roster: contact from %s" % idlib.b2a(nodeid)) eventually(self._educate_the_new_peer, - node, list(self.phonebook.items())) + nodeid, node, list(self.phonebook.items())) eventually(self._announce_new_peer, nodeid, pburl, list(self.connections.values())) self.phonebook[nodeid] = pburl self.connections[nodeid] = node node.notifyOnDisconnect(self._lost_node, nodeid) - def _educate_the_new_peer(self, node, new_peers): + def _educate_the_new_peer(self, nodeid, node, new_peers): + log.msg("roster: educating %s (%d)" % (idlib.b2a(nodeid)[:4], len(new_peers))) node.callRemote("add_peers", new_peers=new_peers) def _announce_new_peer(self, new_nodeid, new_node_pburl, peers): + log.msg("roster: announcing %s to everybody (%d)" % (idlib.b2a(new_nodeid)[:4], len(peers))) for targetnode in peers: targetnode.callRemote("add_peers", new_peers=[(new_nodeid, new_node_pburl)]) diff --git a/allmydata/upload.py b/allmydata/upload.py index 4c932d0c..222c8998 100644 --- a/allmydata/upload.py +++ b/allmydata/upload.py @@ -1,5 +1,5 @@ -from twisted.python import failure +from twisted.python import failure, log from twisted.internet import defer from twisted.application import service @@ -43,6 +43,7 @@ class FileUploader: def start(self): + log.msg("starting upload") if self.debug: print "starting upload" # first step: who should we upload to? -- 2.45.2