better logging for ping
Juan Batiz-Benet committed
Sep 22, 2014 at 15:53 UTC
adcf0bfe7015d7d58139ba62821c053a138220a1
1 file changed
+2
-1
routing/dht/routing.go
+2
-1
@@ -335,10 +335,11 @@ func (dht *IpfsDHT) findPeerMultiple(ctx context.Context, id peer.ID) (*peer.Pee
335
// Ping a peer, log the time it took
336
func (dht *IpfsDHT) Ping(ctx context.Context, p *peer.Peer) error {
337
// Thoughts: maybe this should accept an ID and do a peer lookup?
338
- u.DOut("Enter Ping.\n")
338
+ u.DOut("[%s] ping %s start\n", dht.self.ID.Pretty(), p.ID.Pretty())
339
340
pmes := newMessage(Message_PING, "", 0)
341
_, err := dht.sendRequest(ctx, p, pmes)
342
+ u.DOut("[%s] ping %s end (err = %s)\n", dht.self.ID.Pretty(), p.ID.Pretty(), err)
343
return err
344
}
345