From f09ac4a7704070fd92bae8d4482d06eac45ddd2c Mon Sep 17 00:00:00 2001 From: Alex Potsides Date: Tue, 26 Sep 2023 12:08:01 -0400 Subject: [PATCH] fix(libp2p): update circuit relay and upgrader logs (#2071) Co-authored-by: Chad Nehemiah --- packages/libp2p/src/circuit-relay/transport/index.ts | 2 +- packages/libp2p/src/upgrader.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/libp2p/src/circuit-relay/transport/index.ts b/packages/libp2p/src/circuit-relay/transport/index.ts index 139fb69d7c..483f9a0366 100644 --- a/packages/libp2p/src/circuit-relay/transport/index.ts +++ b/packages/libp2p/src/circuit-relay/transport/index.ts @@ -241,7 +241,7 @@ class CircuitRelayTransport implements Transport { disconnectOnFailure }) } catch (err: any) { - log.error(`Circuit relay dial to destination ${destinationPeer.toString()} via relay ${relayPeer.toString()} failed`, err) + log.error('circuit relay dial to destination %p via relay %p failed', destinationPeer, relayPeer, err) if (stream != null) { stream.abort(err) diff --git a/packages/libp2p/src/upgrader.ts b/packages/libp2p/src/upgrader.ts index 23c3cd0df1..c7a6829175 100644 --- a/packages/libp2p/src/upgrader.ts +++ b/packages/libp2p/src/upgrader.ts @@ -478,7 +478,7 @@ export class DefaultUpgrader implements Upgrader { return muxedStream } catch (err: any) { - log.error('could not create new stream', err) + log.error('could not create new stream for protocols %s on connection with address %a', protocols, connection.remoteAddr, err) if (muxedStream.timeline.close == null) { muxedStream.abort(err)