Skip to content

Commit 5d620d2

Browse files
authored
Reduce logging to lvl 1 for peer connect/disconnect (#1464)
* Reduce logging to lvl 1 for peer connect/disconnect * lvl 1 instead of 2 for local vote and timeout events
1 parent 11be7d3 commit 5d620d2

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

lib/peer.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ func (pp *Peer) cleanupMessageProcessor() {
566566

567567
// We assume that no more elements will be added to the message queue once this function
568568
// is called.
569-
glog.Infof("StartDeSoMessageProcessor: Cleaning up message queue for peer: %v", pp)
569+
glog.V(1).Infof("StartDeSoMessageProcessor: Cleaning up message queue for peer: %v", pp)
570570
pp.messageQueue = nil
571571
// Set a few more things to nil just to make sure the garbage collector doesn't
572572
// get confused when freeing up this Peer's memory. This is to fix a bug where
@@ -579,11 +579,11 @@ func (pp *Peer) cleanupMessageProcessor() {
579579

580580
func (pp *Peer) StartDeSoMessageProcessor() {
581581
pp.startGroup.Done()
582-
glog.Infof("StartDeSoMessageProcessor: Starting for peer %v", pp)
582+
glog.V(1).Infof("StartDeSoMessageProcessor: Starting for peer %v", pp)
583583
for {
584584
if pp.disconnected != 0 {
585585
pp.cleanupMessageProcessor()
586-
glog.Infof("StartDeSoMessageProcessor: Stopping because peer disconnected: %v", pp)
586+
glog.V(1).Infof("StartDeSoMessageProcessor: Stopping because peer disconnected: %v", pp)
587587
return
588588
}
589589
msgToProcess := pp.MaybeDequeueDeSoMessage()
@@ -1267,7 +1267,7 @@ out:
12671267
}
12681268

12691269
func (pp *Peer) Start() {
1270-
glog.Infof("Peer.Start: Starting peer %v", pp)
1270+
glog.V(1).Infof("Peer.Start: Starting peer %v", pp)
12711271
// The protocol has been negotiated successfully so start processing input
12721272
// and output messages.
12731273
pp.startGroup.Add(4)
@@ -1362,7 +1362,7 @@ func (pp *Peer) ReadDeSoMessage() (DeSoMessage, error) {
13621362
// Disconnect closes a peer's network connection.
13631363
func (pp *Peer) Disconnect(reason string) {
13641364
// Only run the logic the first time Disconnect is called.
1365-
glog.V(0).Infof(CLog(Yellow, "Peer.Disconnect: Starting for Peer %v with reason: %v"), pp, reason)
1365+
glog.V(1).Infof(CLog(Yellow, "Peer.Disconnect: Starting for Peer %v with reason: %v"), pp, reason)
13661366
if atomic.LoadInt32(&pp.disconnected) != 0 {
13671367
glog.V(1).Infof("Peer.Disconnect: Disconnect call ignored since it was already called before for Peer %v", pp)
13681368
return

lib/pos_consensus.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ func (fc *FastHotStuffConsensus) handleBlockProposalEvent(
352352
// 3. Process the vote in the consensus module
353353
// 4. Broadcast the vote msg to the network
354354
func (fc *FastHotStuffConsensus) HandleLocalVoteEvent(event *consensus.FastHotStuffEvent) error {
355-
glog.V(2).Infof("FastHotStuffConsensus.HandleLocalVoteEvent: %s", event.ToString())
355+
glog.V(1).Infof("FastHotStuffConsensus.HandleLocalVoteEvent: %s", event.ToString())
356356
glog.V(2).Infof("FastHotStuffConsensus.HandleLocalVoteEvent: %s", fc.fastHotStuffEventLoop.ToString())
357357

358358
// Hold a read lock on the consensus. This is because we need to check the
@@ -444,7 +444,7 @@ func (fc *FastHotStuffConsensus) HandleValidatorVote(pp *Peer, msg *MsgDeSoValid
444444
// 3. Process the timeout in the consensus module
445445
// 4. Broadcast the timeout msg to the network
446446
func (fc *FastHotStuffConsensus) HandleLocalTimeoutEvent(event *consensus.FastHotStuffEvent) error {
447-
glog.V(2).Infof("FastHotStuffConsensus.HandleLocalTimeoutEvent: %s", event.ToString())
447+
glog.V(1).Infof("FastHotStuffConsensus.HandleLocalTimeoutEvent: %s", event.ToString())
448448
glog.V(2).Infof("FastHotStuffConsensus.HandleLocalTimeoutEvent: %s", fc.fastHotStuffEventLoop.ToString())
449449

450450
// Hold a read lock on the consensus. This is because we need to check the

0 commit comments

Comments
 (0)