diff --git a/libp2p/protocols/pubsub/pubsub.nim b/libp2p/protocols/pubsub/pubsub.nim index a08fa009e..9dd1c7f42 100644 --- a/libp2p/protocols/pubsub/pubsub.nim +++ b/libp2p/protocols/pubsub/pubsub.nim @@ -77,7 +77,7 @@ method unsubscribePeer*(p: PubSub, peerId: PeerID) {.base.} = ## handle peer disconnects ## - trace "unsubscribing pubsub peer", peerId + debug "unsubscribing pubsub peer", peerId p.peers.del(peerId) libp2p_pubsub_peers.set(p.peers.len.int64) @@ -149,7 +149,7 @@ proc getOrCreatePeer*( # create new pubsub peer let pubSubPeer = newPubSubPeer(peer, getConn, onEvent, protos[0]) - trace "created new pubsub peer", peer + debug "created new pubsub peer", peer p.peers[peer] = pubSubPeer pubSubPeer.observers = p.observers @@ -224,7 +224,7 @@ method unsubscribe*(p: PubSub, topics: seq[TopicPair]) {.base, async.} = ## unsubscribe from a list of ``topic`` strings for t in topics: - let + let handler = t.handler ttopic = t.topic closureScope: @@ -338,9 +338,9 @@ method validate*(p: PubSub, message: Message): Future[ValidationResult] {.async, if res != ValidationResult.Accept: result = res break - + case result - of ValidationResult.Accept: + of ValidationResult.Accept: libp2p_pubsub_validation_success.inc() of ValidationResult.Reject: libp2p_pubsub_validation_failure.inc() @@ -389,7 +389,7 @@ proc init*[PubParams: object | bool]( switch.addPeerEventHandler(peerEventHandler, PeerEvent.Left) pubsub.initPubSub() - + return pubsub diff --git a/libp2p/stream/lpstream.nim b/libp2p/stream/lpstream.nim index c9cb7f118..baec11976 100644 --- a/libp2p/stream/lpstream.nim +++ b/libp2p/stream/lpstream.nim @@ -124,7 +124,7 @@ method initStream*(s: LPStream) {.base.} = libp2p_open_streams.inc(labelValues = [s.objName, $s.dir]) inc getStreamTracker(s.objName).opened - trace "Stream created", s, objName = s.objName, dir = $s.dir + debug "Stream created", s, objName = s.objName, dir = $s.dir proc join*(s: LPStream): Future[void] = s.closeEvent.wait() @@ -253,7 +253,7 @@ method closeImpl*(s: LPStream): Future[void] {.async, base.} = s.closeEvent.fire() libp2p_open_streams.dec(labelValues = [s.objName, $s.dir]) inc getStreamTracker(s.objName).closed - trace "Closed stream", s, objName = s.objName, dir = $s.dir + debug "Closed stream", s, objName = s.objName, dir = $s.dir method close*(s: LPStream): Future[void] {.base, async.} = # {.raises [Defect].} ## close the stream - this may block, but will not raise exceptions