Skip to content

Commit 67c02b8

Browse files
committed
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 <binhn@us.ibm.com>
1 parent 3406603 commit 67c02b8

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

gossip/gossip/gossip_impl.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ import (
3636
"github.com/hyperledger/fabric/gossip/identity"
3737
"github.com/hyperledger/fabric/gossip/proto"
3838
"github.com/hyperledger/fabric/gossip/util"
39-
"github.com/op/go-logging"
4039
"google.golang.org/grpc"
4140
)
4241

@@ -124,8 +123,6 @@ func NewGossipService(conf *Config, s *grpc.Server, secAdvisor api.SecurityAdvis
124123

125124
g.certStore = newCertStore(g.createCertStorePuller(), idMapper, selfIdentity, mcs)
126125

127-
g.logger.SetLevel(logging.DEBUG)
128-
129126
go g.start()
130127

131128
return g
@@ -181,11 +178,12 @@ func (g *gossipServiceImpl) handlePresumedDead() {
181178
}
182179

183180
func (g *gossipServiceImpl) syncDiscovery() {
181+
g.logger.Debugf("Entering discovery sync with interal %ds", g.conf.PullInterval)
184182
defer g.logger.Debug("Exiting discovery sync loop")
185183
for !g.toDie() {
186-
g.logger.Debug("Intiating discovery sync")
184+
//g.logger.Debug("Intiating discovery sync")
187185
g.disc.InitiateSync(g.conf.PullPeerNum)
188-
g.logger.Debug("Sleeping", g.conf.PullInterval)
186+
//g.logger.Debug("Sleeping", g.conf.PullInterval)
189187
time.Sleep(g.conf.PullInterval)
190188
}
191189
}

gossip/state/state.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ var remoteStateMsgFilter = func(message interface{}) bool {
5555
return message.(comm.ReceivedMessage).GetGossipMessage().IsRemoteStateMessage()
5656
}
5757

58-
5958
const (
6059
defPollingPeriod = 200 * time.Millisecond
6160
defAntiEntropyInterval = 10 * time.Second
@@ -333,11 +332,11 @@ func (s *GossipStateProviderImpl) antiEntropy() {
333332

334333
if current == max {
335334
// No messages in the buffer or there are no gaps
336-
s.logger.Debugf("Current ledger height is the same as ledger height on other peers.")
335+
//s.logger.Debugf("Current ledger height is the same as ledger height on other peers.")
337336
continue
338337
}
339338

340-
s.logger.Debugf("Requesting new blocks in range [%d...%d].", current+1, max)
339+
//s.logger.Debugf("Requesting new blocks in range [%d...%d].", current+1, max)
341340
s.requestBlocksInRange(uint64(current+1), uint64(max))
342341
}
343342
s.logger.Debug("[XXX]: Stateprovider stopped, stoping anti entropy procedure.")

0 commit comments

Comments
 (0)