From f802a16d8d8bf1942fdf8c16f52964532e104f22 Mon Sep 17 00:00:00 2001 From: Yacov Manevich Date: Thu, 29 Aug 2024 22:57:59 +0200 Subject: [PATCH 1/2] Print type of message sent in the verbose log This commit adds the string representation of the message type to the verbose log that notifies about sending a message. Can be useful for troubleshooting issues and it gives better understanding about what the node is doing. Signed-off-by: Yacov Manevich --- network/peer/peer.go | 1 + 1 file changed, 1 insertion(+) diff --git a/network/peer/peer.go b/network/peer/peer.go index c424c1fbdccd..4f84f754a850 100644 --- a/network/peer/peer.go +++ b/network/peer/peer.go @@ -594,6 +594,7 @@ func (p *peer) writeMessages() { func (p *peer) writeMessage(writer io.Writer, msg message.OutboundMessage) { msgBytes := msg.Bytes() p.Log.Verbo("sending message", + zap.String("op", msg.Op().String()), zap.Stringer("nodeID", p.id), zap.Binary("messageBytes", msgBytes), ) From ace68111bd2de4cf17d68ba682cb462b521d1f98 Mon Sep 17 00:00:00 2001 From: yacovm Date: Thu, 29 Aug 2024 23:14:23 +0200 Subject: [PATCH 2/2] Update network/peer/peer.go Co-authored-by: Stephen Buttolph Signed-off-by: yacovm --- network/peer/peer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network/peer/peer.go b/network/peer/peer.go index 4f84f754a850..fb4b3904167a 100644 --- a/network/peer/peer.go +++ b/network/peer/peer.go @@ -594,7 +594,7 @@ func (p *peer) writeMessages() { func (p *peer) writeMessage(writer io.Writer, msg message.OutboundMessage) { msgBytes := msg.Bytes() p.Log.Verbo("sending message", - zap.String("op", msg.Op().String()), + zap.Stringer("op", msg.Op()), zap.Stringer("nodeID", p.id), zap.Binary("messageBytes", msgBytes), )