Skip to content

[Chore] Detailed logging of the handshaked peers#719

Merged
ntallar merged 5 commits intodevelopfrom
chore/log-detailed-peers-info
Oct 7, 2020
Merged

[Chore] Detailed logging of the handshaked peers#719
ntallar merged 5 commits intodevelopfrom
chore/log-detailed-peers-info

Conversation

@ntallar
Copy link
Copy Markdown

@ntallar ntallar commented Oct 2, 2020

Description

More in detail logging of all the handshaked peers a node is connected to

@ntallar ntallar requested a review from mirkoAlic October 2, 2020 13:30
override def toString: String =
s"PeerNetworkStatus {" +
s" RemotePeerAddress: ${peer.remoteAddress}," +
s" ConnectionDirection: ${if (peer.incomingConnection) "Incoming" else "OutGoing"}," +
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: typo: Outgoing

peer,
isBlacklisted = isBlacklisted(peer.id)
)
log.debug(s"${peer.id} - $peerNetworkStatus")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to put everything in one log msg. It will be easier to debug (when we will have structured logging) to have the whole list in one log entry

@ntallar ntallar requested a review from mmrozek October 6, 2020 18:42
Copy link
Copy Markdown
Contributor

@mmrozek mmrozek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comment only. LGTM

peersToDownloadFrom.size
)

val handshakedPeersStatus = handshakedPeers.map { case (peer, info) =>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: should be lazy to avoid evaluation when we work with INFO level of logging

@ntallar ntallar merged commit 6967d09 into develop Oct 7, 2020
@ntallar ntallar deleted the chore/log-detailed-peers-info branch October 7, 2020 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants