diff --git a/libp2p/connmanager.nim b/libp2p/connmanager.nim index f70ca35e79..a2a8674120 100644 --- a/libp2p/connmanager.nim +++ b/libp2p/connmanager.nim @@ -136,7 +136,7 @@ proc triggerConnEvent*(c: ConnManager, peerId: PeerId, event: ConnEvent) {.async except CancelledError as exc: raise exc except CatchableError as exc: - warn "Exception in triggerConnEvents", msg = exc.msg, peer = peerId, event = $event + warn "Exception in triggerConnEvents", exc = exc.msg, peer = peerId, event = $event proc addPeerEventHandler*( c: ConnManager, handler: PeerEventHandler, kind: PeerEventKind @@ -235,7 +235,7 @@ proc muxCleanup(c: ConnManager, mux: Muxer) {.async.} = except CatchableError as exc: # This is top-level procedure which will work as separate task, so it # do not need to propagate CancelledError and should handle other errors - warn "Unexpected exception peer cleanup handler", mux, msg = exc.msg + warn "Unexpected exception peer cleanup handler", mux, exc = exc.msg proc onClose(c: ConnManager, mux: Muxer) {.async.} = ## connection close even handler diff --git a/libp2p/discovery/rendezvousinterface.nim b/libp2p/discovery/rendezvousinterface.nim index d276a772ea..c81d4d3421 100644 --- a/libp2p/discovery/rendezvousinterface.nim +++ b/libp2p/discovery/rendezvousinterface.nim @@ -64,7 +64,7 @@ method advertise*(self: RendezVousInterface) {.async.} = try: await self.rdv.advertise(toAdv, self.ttl) except CatchableError as error: - debug "RendezVous advertise error: ", msg = error.msg + debug "RendezVous advertise error: ", error = error.msg await sleepAsync(self.timeToAdvertise) or self.advertisementUpdated.wait() diff --git a/libp2p/errors.nim b/libp2p/errors.nim index 543856430f..56f93c332e 100644 --- a/libp2p/errors.nim +++ b/libp2p/errors.nim @@ -31,7 +31,7 @@ macro checkFutures*[F](futs: seq[F], exclude: untyped = []): untyped = # We still don't abort but warn debug "A future has failed, enable trace logging for details", error = exc.name - trace "Exception message", msg = exc.msg, stack = getStackTrace() + trace "Exception message", exc = exc.msg, stack = getStackTrace() else: quote: for res in `futs`: @@ -40,9 +40,9 @@ macro checkFutures*[F](futs: seq[F], exclude: untyped = []): untyped = let exc = res.readError() for i in 0 ..< `nexclude`: if exc of `exclude`[i]: - trace "A future has failed", error = exc.name, msg = exc.msg + trace "A future has failed", error = exc.name, exc = exc.msg break check # We still don't abort but warn debug "A future has failed, enable trace logging for details", error = exc.name - trace "Exception details", msg = exc.msg + trace "Exception details", exc = exc.msg diff --git a/libp2p/multistream.nim b/libp2p/multistream.nim index 4e6bf8d819..59fdfb1293 100644 --- a/libp2p/multistream.nim +++ b/libp2p/multistream.nim @@ -212,7 +212,7 @@ proc handle*( except CancelledError as exc: raise exc except CatchableError as exc: - trace "Exception in multistream", conn, msg = exc.msg + trace "Exception in multistream", conn, exc = exc.msg finally: await conn.close() diff --git a/libp2p/muxers/mplex/lpchannel.nim b/libp2p/muxers/mplex/lpchannel.nim index a6b5c51c6d..d829082ae5 100644 --- a/libp2p/muxers/mplex/lpchannel.nim +++ b/libp2p/muxers/mplex/lpchannel.nim @@ -116,7 +116,7 @@ proc reset*(s: LPChannel) {.async: (raises: []).} = trace "sending reset message", s, conn = s.conn await noCancel s.conn.writeMsg(s.id, s.resetCode) # write reset except LPStreamError as exc: - trace "Can't send reset message", s, conn = s.conn, msg = exc.msg + trace "Can't send reset message", s, conn = s.conn, exc = exc.msg await s.conn.close() asyncSpawn resetMessage() @@ -145,7 +145,7 @@ method close*(s: LPChannel) {.async: (raises: []).} = # It's harmless that close message cannot be sent - the connection is # likely down already await s.conn.close() - trace "Cannot send close message", s, id = s.id, msg = exc.msg + trace "Cannot send close message", s, id = s.id, exc = exc.msg await s.closeUnderlying() # maybe already eofed @@ -256,7 +256,7 @@ proc completeWrite( except LPStreamEOFError as exc: raise exc except LPStreamError as exc: - trace "exception in lpchannel write handler", s, msg = exc.msg + trace "exception in lpchannel write handler", s, exc = exc.msg await s.reset() await s.conn.close() raise newLPStreamConnDownError(exc) diff --git a/libp2p/muxers/mplex/mplex.nim b/libp2p/muxers/mplex/mplex.nim index 42e8f4f5da..edf2c669dd 100644 --- a/libp2p/muxers/mplex/mplex.nim +++ b/libp2p/muxers/mplex/mplex.nim @@ -70,7 +70,7 @@ proc cleanupChann(m: Mplex, chann: LPChannel) {.async: (raises: []), inline.} = labelValues = [$chann.initiator, $m.connection.peerId], ) except CancelledError as exc: - warn "Error cleaning up mplex channel", m, chann, msg = exc.msg + warn "Error cleaning up mplex channel", m, chann, exc = exc.msg proc newStreamInternal*( m: Mplex, @@ -175,7 +175,7 @@ method handle*(m: Mplex) {.async: (raises: []).} = except LPStreamClosedError as exc: # Channel is being closed, but `cleanupChann` was not yet triggered. trace "pushing data to channel failed", - m, channel, len = data.len, msg = exc.msg + m, channel, len = data.len, exc = exc.msg discard # Ignore message, same as if `cleanupChann` had completed. of MessageType.CloseIn, MessageType.CloseOut: await channel.pushEof() @@ -185,11 +185,11 @@ method handle*(m: Mplex) {.async: (raises: []).} = except CancelledError: debug "Unexpected cancellation in mplex handler", m except LPStreamEOFError as exc: - trace "Stream EOF", m, msg = exc.msg + trace "Stream EOF", m, exc = exc.msg except LPStreamError as exc: - debug "Unexpected stream exception in mplex read loop", m, msg = exc.msg + debug "Unexpected stream exception in mplex read loop", m, exc = exc.msg except MuxerError as exc: - debug "Unexpected muxer exception in mplex read loop", m, msg = exc.msg + debug "Unexpected muxer exception in mplex read loop", m, exc = exc.msg finally: await m.close() trace "Stopped mplex handler", m diff --git a/libp2p/muxers/yamux/yamux.nim b/libp2p/muxers/yamux/yamux.nim index 10ad33773e..e4518222dd 100644 --- a/libp2p/muxers/yamux/yamux.nim +++ b/libp2p/muxers/yamux/yamux.nim @@ -513,9 +513,9 @@ method close*(m: Yamux) {.async: (raises: []).} = try: await m.connection.write(YamuxHeader.goAway(NormalTermination)) except CancelledError as exc: - trace "cancelled sending goAway", msg = exc.msg + trace "cancelled sending goAway", exc = exc.msg except LPStreamError as exc: - trace "failed to send goAway", msg = exc.msg + trace "failed to send goAway", exc = exc.msg await m.connection.close() trace "Closed yamux" @@ -601,7 +601,7 @@ method handle*(m: Yamux) {.async: (raises: []).} = if header.length > 0: var buffer = newSeqUninitialized[byte](header.length) await m.connection.readExactly(addr buffer[0], int(header.length)) - trace "Msg Rcv", msg = shortLog(buffer) + trace "Message received", message = shortLog(buffer) await channel.gotDataFromRemote(buffer) if MsgFlags.Fin in header.flags: @@ -611,11 +611,11 @@ method handle*(m: Yamux) {.async: (raises: []).} = trace "remote reset channel" await channel.reset() except CancelledError as exc: - debug "Unexpected cancellation in yamux handler", msg = exc.msg + debug "Unexpected cancellation in yamux handler", exc = exc.msg except LPStreamEOFError as exc: - trace "Stream EOF", msg = exc.msg + trace "Stream EOF", exc = exc.msg except LPStreamError as exc: - debug "Unexpected stream exception in yamux read loop", msg = exc.msg + debug "Unexpected stream exception in yamux read loop", exc = exc.msg except YamuxError as exc: trace "Closing yamux connection", error = exc.msg try: @@ -623,7 +623,7 @@ method handle*(m: Yamux) {.async: (raises: []).} = except CancelledError, LPStreamError: discard except MuxerError as exc: - debug "Unexpected muxer exception in yamux read loop", msg = exc.msg + debug "Unexpected muxer exception in yamux read loop", exc = exc.msg try: await m.connection.write(YamuxHeader.goAway(ProtocolError)) except CancelledError, LPStreamError: diff --git a/libp2p/nameresolving/dnsresolver.nim b/libp2p/nameresolving/dnsresolver.nim index 8ad905ed89..229ad00c9d 100644 --- a/libp2p/nameresolving/dnsresolver.nim +++ b/libp2p/nameresolving/dnsresolver.nim @@ -41,7 +41,7 @@ proc questionToBuf(address: string, kind: QKind): seq[byte] = discard requestStream.readData(addr buf[0], dataLen) return buf except CatchableError as exc: - info "Failed to created DNS buffer", msg = exc.msg + info "Failed to created DNS buffer", exc = exc.msg return newSeq[byte](0) proc getDnsResponse( diff --git a/libp2p/protocols/connectivity/autonat/service.nim b/libp2p/protocols/connectivity/autonat/service.nim index 8fe352b7cb..e28f5129d1 100644 --- a/libp2p/protocols/connectivity/autonat/service.nim +++ b/libp2p/protocols/connectivity/autonat/service.nim @@ -146,13 +146,13 @@ proc askPeer( debug "dialMe answer is reachable" Reachable except AutonatUnreachableError as error: - debug "dialMe answer is not reachable", msg = error.msg + debug "dialMe answer is not reachable", error = error.msg NotReachable except AsyncTimeoutError as error: - debug "dialMe timed out", msg = error.msg + debug "dialMe timed out", error = error.msg Unknown except CatchableError as error: - debug "dialMe unexpected error", msg = error.msg + debug "dialMe unexpected error", error = error.msg Unknown let hasReachabilityOrConfidenceChanged = await self.handleAnswer(ans) if hasReachabilityOrConfidenceChanged: @@ -194,7 +194,7 @@ proc addressMapper( processedMA = peerStore.guessDialableAddr(listenAddr) # handle manual port forwarding except CatchableError as exc: - debug "Error while handling address mapper", msg = exc.msg + debug "Error while handling address mapper", exc = exc.msg addrs.add(processedMA) return addrs diff --git a/libp2p/protocols/connectivity/dcutr/client.nim b/libp2p/protocols/connectivity/dcutr/client.nim index 1c9fcb3259..60b618c18e 100644 --- a/libp2p/protocols/connectivity/dcutr/client.nim +++ b/libp2p/protocols/connectivity/dcutr/client.nim @@ -88,7 +88,7 @@ proc startSync*( raise err except AllFuturesFailedError as err: debug "Dcutr initiator could not connect to the remote peer, all connect attempts failed", - peerDialableAddrs, msg = err.msg + peerDialableAddrs, error = err.msg raise newException( DcutrError, "Dcutr initiator could not connect to the remote peer, all connect attempts failed", @@ -96,7 +96,7 @@ proc startSync*( ) except AsyncTimeoutError as err: debug "Dcutr initiator could not connect to the remote peer, all connect attempts timed out", - peerDialableAddrs, msg = err.msg + peerDialableAddrs, error = err.msg raise newException( DcutrError, "Dcutr initiator could not connect to the remote peer, all connect attempts timed out", diff --git a/libp2p/protocols/connectivity/dcutr/server.nim b/libp2p/protocols/connectivity/dcutr/server.nim index 1a44b2b06c..1efd6b17e2 100644 --- a/libp2p/protocols/connectivity/dcutr/server.nim +++ b/libp2p/protocols/connectivity/dcutr/server.nim @@ -80,13 +80,13 @@ proc new*( raise err except AllFuturesFailedError as err: debug "Dcutr receiver could not connect to the remote peer, " & - "all connect attempts failed", peerDialableAddrs, msg = err.msg + "all connect attempts failed", peerDialableAddrs, error = err.msg except AsyncTimeoutError as err: debug "Dcutr receiver could not connect to the remote peer, " & - "all connect attempts timed out", peerDialableAddrs, msg = err.msg + "all connect attempts timed out", peerDialableAddrs, error = err.msg except CatchableError as err: warn "Unexpected error when Dcutr receiver tried to connect " & - "to the remote peer", msg = err.msg + "to the remote peer", error = err.msg let self = T() self.handler = handleStream diff --git a/libp2p/protocols/connectivity/relay/client.nim b/libp2p/protocols/connectivity/relay/client.nim index 15f0334457..35df810b26 100644 --- a/libp2p/protocols/connectivity/relay/client.nim +++ b/libp2p/protocols/connectivity/relay/client.nim @@ -196,7 +196,7 @@ proc dialPeerV2*( if msgRcvFromRelay.msgType != HopMessageType.Status: raise newException(RelayV2DialError, "Unexpected stop response") if msgRcvFromRelay.status.get(UnexpectedMessage) != Ok: - trace "Relay stop failed", msg = msgRcvFromRelay.status + trace "Relay stop failed", msgStatus = msgRcvFromRelay.status raise newException(RelayV2DialError, "Relay stop failure") conn.limitDuration = msgRcvFromRelay.limit.duration conn.limitData = msgRcvFromRelay.limit.data @@ -206,7 +206,7 @@ proc handleStopStreamV2(cl: RelayClient, conn: Connection) {.async.} = let msg = StopMessage.decode(await conn.readLp(RelayClientMsgSize)).valueOr: await sendHopStatus(conn, MalformedMessage) return - trace "client circuit relay v2 handle stream", msg + trace "client circuit relay v2 handle stream", message = msg if msg.msgType == StopMessageType.Connect: await cl.handleRelayedConnect(conn, msg) @@ -245,7 +245,7 @@ proc handleStreamV1(cl: RelayClient, conn: Connection) {.async.} = let msg = RelayMessage.decode(await conn.readLp(RelayClientMsgSize)).valueOr: await sendStatus(conn, StatusV1.MalformedMessage) return - trace "client circuit relay v1 handle stream", msg + trace "client circuit relay v1 handle stream", message = msg let typ = msg.msgType.valueOr: trace "Message type not set" diff --git a/libp2p/protocols/connectivity/relay/relay.nim b/libp2p/protocols/connectivity/relay/relay.nim index a6c76125a2..b6b4c45347 100644 --- a/libp2p/protocols/connectivity/relay/relay.nim +++ b/libp2p/protocols/connectivity/relay/relay.nim @@ -196,7 +196,7 @@ proc handleConnect(r: Relay, connSrc: Connection, msg: HopMessage) {.async.} = except CancelledError as exc: raise exc except CatchableError as exc: - trace "error sending stop message", msg = exc.msg + trace "error sending stop message", exc = exc.msg await sendHopStatus(connSrc, ConnectionFailed) return @@ -213,7 +213,7 @@ proc handleHopStreamV2*(r: Relay, conn: Connection) {.async.} = let msg = HopMessage.decode(await conn.readLp(r.msgSize)).valueOr: await sendHopStatus(conn, MalformedMessage) return - trace "relayv2 handle stream", msg = msg + trace "relayv2 handle stream", message = msg case msg.msgType of HopMessageType.Reserve: await r.handleReserve(conn) @@ -294,7 +294,7 @@ proc handleHop*(r: Relay, connSrc: Connection, msg: RelayMessage) {.async.} = return let msgRcvFromDst = msgRcvFromDstOpt.valueOr: - trace "error reading stop response", msg = msgRcvFromDstOpt + trace "error reading stop response", msgRcvFromDstOpt await sendStatus(connSrc, StatusV1.HopCantOpenDstStream) return @@ -312,7 +312,7 @@ proc handleStreamV1(r: Relay, conn: Connection) {.async.} = let msg = RelayMessage.decode(await conn.readLp(r.msgSize)).valueOr: await sendStatus(conn, StatusV1.MalformedMessage) return - trace "relay handle stream", msg + trace "relay handle stream", message = msg let typ = msg.msgType.valueOr: trace "Message type not set" diff --git a/libp2p/protocols/pubsub/floodsub.nim b/libp2p/protocols/pubsub/floodsub.nim index 463ddacc67..1bced6da35 100644 --- a/libp2p/protocols/pubsub/floodsub.nim +++ b/libp2p/protocols/pubsub/floodsub.nim @@ -106,7 +106,7 @@ method rpcHandler*(f: FloodSub, peer: PubSubPeer, data: seq[byte]) {.async.} = debug "failed to decode msg from peer", peer, err = error raise newException(CatchableError, "Peer msg couldn't be decoded") - trace "decoded msg from peer", peer, msg = rpcMsg.shortLog + trace "decoded msg from peer", peer, rpcMsg = rpcMsg.shortLog # trigger hooks peer.recvObservers(rpcMsg) @@ -219,7 +219,7 @@ method publish*(f: FloodSub, topic: string, data: seq[byte]): Future[int] {.asyn trace "Error generating message id, skipping publish", error = error return 0 - trace "Created new message", msg = shortLog(msg), peers = peers.len, topic, msgId + trace "Created new message", message = shortLog(msg), peers = peers.len, topic, msgId if f.addSeen(f.salt(msgId)): # custom msgid providers might cause this diff --git a/libp2p/protocols/pubsub/gossipsub.nim b/libp2p/protocols/pubsub/gossipsub.nim index 03a105ea02..ea4a087f3c 100644 --- a/libp2p/protocols/pubsub/gossipsub.nim +++ b/libp2p/protocols/pubsub/gossipsub.nim @@ -368,7 +368,7 @@ proc handleControl(g: GossipSub, peer: PubSubPeer, control: ControlMessage) = else: libp2p_pubsub_broadcast_prune.inc(labelValues = ["generic"]) - trace "sending control message", msg = shortLog(respControl), peer + trace "sending control message", respControl = shortLog(respControl), peer g.send(peer, RPCMsg(control: some(respControl)), isHighPriority = true) if messages.len > 0: @@ -491,7 +491,7 @@ proc validateAndRelay( await handleData(g, topic, msg.data) except CatchableError as exc: - info "validateAndRelay failed", msg = exc.msg + info "validateAndRelay failed", exc = exc.msg proc dataAndTopicsIdSize(msgs: seq[Message]): int = msgs.mapIt(it.data.len + it.topic.len).foldl(a + b, 0) @@ -540,7 +540,7 @@ method rpcHandler*(g: GossipSub, peer: PubSubPeer, data: seq[byte]) {.async.} = for m in rpcMsg.messages: libp2p_pubsub_received_messages.inc(labelValues = [$peer.peerId, m.topic]) - trace "decoded msg from peer", peer, msg = rpcMsg.shortLog + trace "decoded msg from peer", peer, rpcMsg = rpcMsg.shortLog await rateLimit(g, peer, g.messageOverhead(rpcMsg, msgSize)) # trigger hooks - these may modify the message @@ -771,7 +771,7 @@ method publish*(g: GossipSub, topic: string, data: seq[byte]): Future[int] {.asy logScope: msgId = shortLog(msgId) - trace "Created new message", msg = shortLog(msg), peers = peers.len + trace "Created new message", message = shortLog(msg), peers = peers.len if g.addSeen(g.salt(msgId)): # If the message was received or published recently, don't re-publish it - @@ -806,7 +806,7 @@ proc maintainDirectPeer(g: GossipSub, id: PeerId, addrs: seq[MultiAddress]) {.as trace "Direct peer dial canceled" raise exc except CatchableError as exc: - debug "Direct peer error dialing", msg = exc.msg + debug "Direct peer error dialing", exc = exc.msg proc addDirectPeer*(g: GossipSub, id: PeerId, addrs: seq[MultiAddress]) {.async.} = g.parameters.directPeers[id] = addrs diff --git a/libp2p/protocols/pubsub/gossipsub/scoring.nim b/libp2p/protocols/pubsub/gossipsub/scoring.nim index 1233e22621..1213098888 100644 --- a/libp2p/protocols/pubsub/gossipsub/scoring.nim +++ b/libp2p/protocols/pubsub/gossipsub/scoring.nim @@ -135,7 +135,7 @@ proc disconnectPeer*(g: GossipSub, peer: PubSubPeer) {.async.} = try: await g.switch.disconnect(peer.peerId) except CatchableError as exc: # Never cancelled - trace "Failed to close connection", peer, error = exc.name, msg = exc.msg + trace "Failed to close connection", peer, error = exc.name, exc = exc.msg proc disconnectIfBadScorePeer*(g: GossipSub, peer: PubSubPeer, score: float64) = if g.parameters.disconnectBadPeers and score < g.parameters.graylistThreshold and diff --git a/libp2p/protocols/pubsub/pubsub.nim b/libp2p/protocols/pubsub/pubsub.nim index 0fba5956b7..da10c0b354 100644 --- a/libp2p/protocols/pubsub/pubsub.nim +++ b/libp2p/protocols/pubsub/pubsub.nim @@ -197,7 +197,7 @@ proc send*( ## High priority messages are sent immediately, while low priority messages are queued and sent only after all high ## priority messages have been sent. - trace "sending pubsub message to peer", peer, msg = shortLog(msg) + trace "sending pubsub message to peer", peer, message = shortLog(msg) peer.send(msg, p.anonymize, isHighPriority) proc broadcast*( @@ -255,7 +255,7 @@ proc broadcast*( else: libp2p_pubsub_broadcast_prune.inc(npeers, labelValues = ["generic"]) - trace "broadcasting messages to peers", peers = sendPeers.len, msg = shortLog(msg) + trace "broadcasting messages to peers", peers = sendPeers.len, message = shortLog(msg) if anyIt(sendPeers, it.hasObservers): for peer in sendPeers: @@ -403,7 +403,7 @@ proc handleData*(p: PubSub, topic: string, data: seq[byte]): Future[void] = for fut in futs: if fut.failed: let err = fut.readError() - warn "Error in topic handler", msg = err.msg + warn "Error in topic handler", error = err.msg return waiter() diff --git a/libp2p/protocols/pubsub/pubsubpeer.nim b/libp2p/protocols/pubsub/pubsubpeer.nim index 79c5c90de4..90c170e0ca 100644 --- a/libp2p/protocols/pubsub/pubsubpeer.nim +++ b/libp2p/protocols/pubsub/pubsubpeer.nim @@ -283,7 +283,7 @@ proc connectImpl(p: PubSubPeer) {.async.} = return await connectOnce(p) except CatchableError as exc: # never cancelled - debug "Could not establish send connection", msg = exc.msg + debug "Could not establish send connection", exc = exc.msg proc connect*(p: PubSubPeer) = if p.connected: @@ -325,7 +325,7 @@ proc sendMsgContinue(conn: Connection, msgFut: Future[void]) {.async.} = except CatchableError as exc: # never cancelled # Because we detach the send call from the currently executing task using # asyncSpawn, no exceptions may leak out of it - trace "Unable to send to remote", conn, msg = exc.msg + trace "Unable to send to remote", conn, exc = exc.msg # Next time sendConn is used, it will be have its close flag set and thus # will be recycled @@ -341,7 +341,7 @@ proc sendMsgSlow(p: PubSubPeer, msg: seq[byte]) {.async.} = var conn = p.sendConn if conn == nil or conn.closed(): - debug "No send connection", p, msg = shortLog(msg) + debug "No send connection", p, message = shortLog(msg) return trace "sending encoded msg to peer", conn, encoded = shortLog(msg) @@ -383,7 +383,7 @@ proc sendEncoded*(p: PubSubPeer, msg: seq[byte], isHighPriority: bool): Future[v ) == 0 if msg.len <= 0: - debug "empty message, skipping", p, msg = shortLog(msg) + debug "empty message, skipping", p, message = shortLog(msg) Future[void].completed() elif msg.len > p.maxMessageSize: info "trying to send a msg too big for pubsub", diff --git a/libp2p/protocols/pubsub/rpc/protobuf.nim b/libp2p/protocols/pubsub/rpc/protobuf.nim index d093a0c8fc..c6d4c0d66b 100644 --- a/libp2p/protocols/pubsub/rpc/protobuf.nim +++ b/libp2p/protocols/pubsub/rpc/protobuf.nim @@ -310,7 +310,7 @@ proc decodeMessages*(pb: ProtoBuffer): ProtoResult[seq[Message]] {.inline.} = ok(msgs) proc encodeRpcMsg*(msg: RPCMsg, anonymize: bool): seq[byte] = - trace "encodeRpcMsg: encoding message", msg = msg.shortLog() + trace "encodeRpcMsg: encoding message", message = msg.shortLog() var pb = initProtoBuffer(maxSize = uint.high) for item in msg.subscriptions: pb.write(1, item) @@ -329,7 +329,7 @@ proc encodeRpcMsg*(msg: RPCMsg, anonymize: bool): seq[byte] = pb.buffer proc decodeRpcMsg*(msg: seq[byte]): ProtoResult[RPCMsg] {.inline.} = - trace "decodeRpcMsg: decoding message", msg = msg.shortLog() + trace "decodeRpcMsg: decoding message", message = msg.shortLog() var pb = initProtoBuffer(msg, maxSize = uint.high) var rpcMsg = RPCMsg() assign(rpcMsg.messages, ?pb.decodeMessages()) diff --git a/libp2p/stream/lpstream.nim b/libp2p/stream/lpstream.nim index 12eedfe00b..72a4a1ac8a 100644 --- a/libp2p/stream/lpstream.nim +++ b/libp2p/stream/lpstream.nim @@ -326,4 +326,4 @@ proc closeWithEOF*(s: LPStream): Future[void] {.async: (raises: []), public.} = except LPStreamEOFError: trace "Expected EOF came", s except LPStreamError as exc: - debug "Unexpected error while waiting for EOF", s, msg = exc.msg + debug "Unexpected error while waiting for EOF", s, exc = exc.msg diff --git a/libp2p/switch.nim b/libp2p/switch.nim index d6ea195cb9..651b87558d 100644 --- a/libp2p/switch.nim +++ b/libp2p/switch.nim @@ -296,7 +296,7 @@ proc stop*(s: Switch) {.async, public.} = except CancelledError as exc: raise exc except CatchableError as exc: - warn "error cleaning up transports", msg = exc.msg + warn "error cleaning up transports", exc = exc.msg await s.ms.stop() diff --git a/tests/hole-punching-interop/hole_punching.nim b/tests/hole-punching-interop/hole_punching.nim index 4e995dac35..f09044f38d 100644 --- a/tests/hole-punching-interop/hole_punching.nim +++ b/tests/hole-punching-interop/hole_punching.nim @@ -120,7 +120,7 @@ proc main() {.async.} = echo &"""{{"rtt_to_holepunched_peer_millis":{delay.millis}}}""" quit(0) except CatchableError as e: - error "Unexpected error", msg = e.msg + error "Unexpected error", error = e.msg discard waitFor(main().withTimeout(4.minutes)) quit(1)