Skip to content

Commit

Permalink
fix log params (hyperledger#6254)
Browse files Browse the repository at this point in the history
Signed-off-by: Sally MacFarlane <[email protected]>
Co-authored-by: Stefan Pingel <[email protected]>
Signed-off-by: jflo <[email protected]>
  • Loading branch information
2 people authored and jflo committed Dec 12, 2023
1 parent ef2db43 commit 3ee481b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,11 @@ private void handleStatusMessage(final EthPeer peer, final Message message) {
message.getConnection());
}
} catch (final RLPException e) {
LOG.debug("Unable to parse status message from peer {}.", peer, e);
LOG.atDebug()
.setMessage("Unable to parse status message from peer {}... {}")
.addArgument(peer::getShortNodeId)
.addArgument(e)
.log();
// Parsing errors can happen when clients broadcast network ids outside the int range,
// So just disconnect with "subprotocol" error rather than "breach of protocol".
peer.disconnect(DisconnectReason.SUBPROTOCOL_TRIGGERED);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ public void onPeerConnected(final EthPeer peer) {
.addArgument(peer::getShortNodeId)
.log();
} else {
LOG.debug("Failed to retrieve chain head info. Disconnecting {}", peer, error);
LOG.atDebug()
.setMessage("Failed to retrieve chain head info. Disconnecting {}... {}")
.addArgument(peer::getShortNodeId)
.addArgument(error)
.log();
peer.disconnect(DisconnectReason.USELESS_PEER);
}
});
Expand Down

0 comments on commit 3ee481b

Please sign in to comment.