Skip to content

Commit

Permalink
fix: log peer data in identify correctly (#2197)
Browse files Browse the repository at this point in the history
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]`.
  • Loading branch information
achingbrain committed Nov 6, 2023
1 parent 5cba173 commit fdcb801
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/libp2p/src/identify/identify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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
})
Expand Down

0 comments on commit fdcb801

Please sign in to comment.