add more logging

This commit is contained in:
Brian Warner 2006-12-03 00:53:53 -07:00
parent 1ba241e071
commit eedef54a72
2 changed files with 6 additions and 3 deletions

View File

@ -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)])

View File

@ -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?