From 67c02b84ddca7a12fc7533ce30a3f256c6c0ef58 Mon Sep 17 00:00:00 2001 From: "Binh Q. Nguyen" Date: Fri, 13 Jan 2017 14:11:34 -0500 Subject: [PATCH] Remove repeating log outputs In gossip, a couple of polling loops continuously output debug logs that makes debugging difficult. I am removing them at this point. Note also that logging level shouldn't be set in the code but in the yaml file to be controlled by the environment. Change-Id: I7af3fbeaef492aa848ccd8fbcf7c741263caf13f Signed-off-by: Binh Q. Nguyen --- gossip/gossip/gossip_impl.go | 8 +++----- gossip/state/state.go | 5 ++--- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/gossip/gossip/gossip_impl.go b/gossip/gossip/gossip_impl.go index ed1b82e1c85..a6781b6781f 100644 --- a/gossip/gossip/gossip_impl.go +++ b/gossip/gossip/gossip_impl.go @@ -36,7 +36,6 @@ import ( "github.com/hyperledger/fabric/gossip/identity" "github.com/hyperledger/fabric/gossip/proto" "github.com/hyperledger/fabric/gossip/util" - "github.com/op/go-logging" "google.golang.org/grpc" ) @@ -124,8 +123,6 @@ func NewGossipService(conf *Config, s *grpc.Server, secAdvisor api.SecurityAdvis g.certStore = newCertStore(g.createCertStorePuller(), idMapper, selfIdentity, mcs) - g.logger.SetLevel(logging.DEBUG) - go g.start() return g @@ -181,11 +178,12 @@ func (g *gossipServiceImpl) handlePresumedDead() { } func (g *gossipServiceImpl) syncDiscovery() { + g.logger.Debugf("Entering discovery sync with interal %ds", g.conf.PullInterval) defer g.logger.Debug("Exiting discovery sync loop") for !g.toDie() { - g.logger.Debug("Intiating discovery sync") + //g.logger.Debug("Intiating discovery sync") g.disc.InitiateSync(g.conf.PullPeerNum) - g.logger.Debug("Sleeping", g.conf.PullInterval) + //g.logger.Debug("Sleeping", g.conf.PullInterval) time.Sleep(g.conf.PullInterval) } } diff --git a/gossip/state/state.go b/gossip/state/state.go index f2930d11a6f..cd2b299630f 100644 --- a/gossip/state/state.go +++ b/gossip/state/state.go @@ -55,7 +55,6 @@ var remoteStateMsgFilter = func(message interface{}) bool { return message.(comm.ReceivedMessage).GetGossipMessage().IsRemoteStateMessage() } - const ( defPollingPeriod = 200 * time.Millisecond defAntiEntropyInterval = 10 * time.Second @@ -333,11 +332,11 @@ func (s *GossipStateProviderImpl) antiEntropy() { if current == max { // No messages in the buffer or there are no gaps - s.logger.Debugf("Current ledger height is the same as ledger height on other peers.") + //s.logger.Debugf("Current ledger height is the same as ledger height on other peers.") continue } - s.logger.Debugf("Requesting new blocks in range [%d...%d].", current+1, max) + //s.logger.Debugf("Requesting new blocks in range [%d...%d].", current+1, max) s.requestBlocksInRange(uint64(current+1), uint64(max)) } s.logger.Debug("[XXX]: Stateprovider stopped, stoping anti entropy procedure.")