From ea378c5565fc8f57d7b100dea5972919ffab4a62 Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Wed, 9 Dec 2015 11:54:08 -0800 Subject: [PATCH] Improve logging --- consensus/height_vote_set.go | 1 - consensus/reactor.go | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/consensus/height_vote_set.go b/consensus/height_vote_set.go index aa87728b..3ee69391 100644 --- a/consensus/height_vote_set.go +++ b/consensus/height_vote_set.go @@ -134,7 +134,6 @@ func (hvs *HeightVoteSet) POLRound() int { } func (hvs *HeightVoteSet) getVoteSet(round int, type_ byte) *types.VoteSet { - log.Debug("getVoteSet(round)", "round", round, "type", type_) rvs, ok := hvs.roundVoteSets[round] if !ok { return nil diff --git a/consensus/reactor.go b/consensus/reactor.go index 5da5ce56..b5de47ec 100644 --- a/consensus/reactor.go +++ b/consensus/reactor.go @@ -313,7 +313,7 @@ func (conR *ConsensusReactor) sendNewRoundStepMessage(peer *p2p.Peer) { } func (conR *ConsensusReactor) gossipDataRoutine(peer *p2p.Peer, ps *PeerState) { - log := log.New("peer", peer.Key) + log := log.New("peer", peer) OUTER_LOOP: for { @@ -419,7 +419,7 @@ OUTER_LOOP: } func (conR *ConsensusReactor) gossipVotesRoutine(peer *p2p.Peer, ps *PeerState) { - log := log.New("peer", peer.Key) + log := log.New("peer", peer) // Simple hack to throttle logs upon sleep. var sleeping = 0 @@ -441,8 +441,8 @@ OUTER_LOOP: sleeping = 0 } - log.Debug("gossipVotesRoutine", "rsHeight", rs.Height, "rsRound", rs.Round, - "prsHeight", prs.Height, "prsRound", prs.Round, "prsStep", prs.Step) + //log.Debug("gossipVotesRoutine", "rsHeight", rs.Height, "rsRound", rs.Round, + // "prsHeight", prs.Height, "prsRound", prs.Round, "prsStep", prs.Step) // If height matches, then send LastCommit, Prevotes, Precommits. if rs.Height == prs.Height { @@ -749,7 +749,7 @@ func (ps *PeerState) SetHasVote(vote *types.Vote, index int) { } func (ps *PeerState) setHasVote(height int, round int, type_ byte, index int) { - log := log.New("peer", ps.Peer.Key, "peerRound", ps.Round, "height", height, "round", round) + log := log.New("peer", ps.Peer, "peerRound", ps.Round, "height", height, "round", round) if type_ != types.VoteTypePrevote && type_ != types.VoteTypePrecommit { PanicSanity("Invalid vote type") }