From fdcb801ee3180b740a25e0e05a75c32dd8e4ef63 Mon Sep 17 00:00:00 2001 From: Alex Potsides Date: Mon, 6 Nov 2023 07:43:30 +0000 Subject: [PATCH] fix: log peer data in identify correctly (#2197) When logging peer data, pass the peer id and the update to the logger instead of just the update values, otherwise the values get logged as `[object Object]`. --- packages/libp2p/src/identify/identify.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/libp2p/src/identify/identify.ts b/packages/libp2p/src/identify/identify.ts index ea5fbcf796..c3f71fc696 100644 --- a/packages/libp2p/src/identify/identify.ts +++ b/packages/libp2p/src/identify/identify.ts @@ -495,7 +495,7 @@ export class DefaultIdentifyService implements Startable, IdentifyService { log('%p did not send a signed peer record', connection.remotePeer) } - log('patching %p with', peer) + log('patching %p with', connection.remotePeer, peer) await this.peerStore.patch(connection.remotePeer, peer) if (message.agentVersion != null || message.protocolVersion != null) { @@ -509,7 +509,7 @@ export class DefaultIdentifyService implements Startable, IdentifyService { metadata.ProtocolVersion = uint8ArrayFromString(message.protocolVersion) } - log('updating %p metadata', peer) + log('merging %p metadata', connection.remotePeer, metadata) await this.peerStore.merge(connection.remotePeer, { metadata })