From e8b6a45fe0225269a0a0be838b025a597573edd0 Mon Sep 17 00:00:00 2001 From: Leo Chen Date: Thu, 8 Nov 2018 23:07:40 -0800 Subject: [PATCH] log size of messages in log file Signed-off-by: Leo Chen --- consensus/consensus_validator.go | 3 +-- p2p/peer.go | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/consensus/consensus_validator.go b/consensus/consensus_validator.go index 59787c34f..94ddf8f6a 100644 --- a/consensus/consensus_validator.go +++ b/consensus/consensus_validator.go @@ -27,7 +27,6 @@ func (consensus *Consensus) ProcessMessageValidator(message []byte) { consensus.Log.Error("Failed to get consensus message payload", "err", err, "consensus", consensus) } - consensus.Log.Info("Received consensus Message", "type", msgType) switch msgType { case proto_consensus.Announce: consensus.processAnnounceMessage(payload) @@ -44,7 +43,7 @@ func (consensus *Consensus) ProcessMessageValidator(message []byte) { // Processes the announce message sent from the leader func (consensus *Consensus) processAnnounceMessage(payload []byte) { - consensus.Log.Info("Received Announce Message") + consensus.Log.Info("Received Announce Message", "Size", len(payload)) //#### Read payload data offset := 0 // 4 byte consensus id diff --git a/p2p/peer.go b/p2p/peer.go index 59eb0664f..02472af16 100644 --- a/p2p/peer.go +++ b/p2p/peer.go @@ -42,7 +42,7 @@ func BroadcastMessage(peers []Peer, msg []byte) { // Construct broadcast p2p message content := ConstructP2pMessage(byte(17), msg) - log.Info("Start Broadcasting", "gomaxprocs", runtime.GOMAXPROCS(0)) + log.Info("Start Broadcasting", "gomaxprocs", runtime.GOMAXPROCS(0), "Size", len(content)) start := time.Now() for _, peer := range peers { peerCopy := peer