Skip to content

Commit

Permalink
Remove repeating log outputs
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
binhn committed Jan 13, 2017
1 parent 3406603 commit 67c02b8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
8 changes: 3 additions & 5 deletions gossip/gossip/gossip_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
}
}
Expand Down
5 changes: 2 additions & 3 deletions gossip/state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.")
Expand Down

0 comments on commit 67c02b8

Please sign in to comment.