diff --git a/libp2p/multistream.nim b/libp2p/multistream.nim index ce848a7a2d..26c2149f20 100644 --- a/libp2p/multistream.nim +++ b/libp2p/multistream.nim @@ -129,7 +129,7 @@ proc handle*(m: MultistreamSelect, conn: Connection, active: bool = false) {.asy if not handshaked and ms != Codec: error "expected handshake message", instead=ms - raise newException(CatchableError, + raise newException(CatchableError, "MultistreamSelect handling failed, invalid first message") trace "handle: got request for ", ms @@ -154,7 +154,7 @@ proc handle*(m: MultistreamSelect, conn: Connection, active: bool = false) {.asy await conn.write(m.codec) handshaked = true else: - await conn.write(Na) + await conn.write(Na) else: for h in m.handlers: if (not isNil(h.match) and h.match(ms)) or ms == h.proto: @@ -162,7 +162,7 @@ proc handle*(m: MultistreamSelect, conn: Connection, active: bool = false) {.asy await conn.writeLp((h.proto & "\n")) await h.protocol.handler(conn, ms) return - debug "no handlers for ", protocol = ms + debug "no handlers for", protocol = ms await conn.write(Na) except CancelledError as exc: await conn.close() diff --git a/libp2p/stream/connection.nim b/libp2p/stream/connection.nim index 60d5be845b..487399bc0d 100644 --- a/libp2p/stream/connection.nim +++ b/libp2p/stream/connection.nim @@ -8,13 +8,16 @@ ## those terms. import hashes -import chronos, metrics +import chronos, metrics, chronicles import lpstream, ../multiaddress, ../peerinfo export lpstream +logScope: + topics = "connection" + const ConnectionTrackerName* = "libp2p.connection" diff --git a/libp2p/stream/lpstream.nim b/libp2p/stream/lpstream.nim index cea09339da..1c4269160a 100644 --- a/libp2p/stream/lpstream.nim +++ b/libp2p/stream/lpstream.nim @@ -16,6 +16,9 @@ import ../varint, declareGauge(libp2p_open_streams, "open stream instances", labels = ["type"]) +logScope: + topics = "lpstream" + type LPStream* = ref object of RootObj closeEvent*: AsyncEvent