Improve logging

This commit is contained in:
Jae Kwon 2015-12-09 11:54:08 -08:00
parent 15b751107e
commit ea378c5565
2 changed files with 5 additions and 6 deletions

View File

@ -134,7 +134,6 @@ func (hvs *HeightVoteSet) POLRound() int {
} }
func (hvs *HeightVoteSet) getVoteSet(round int, type_ byte) *types.VoteSet { func (hvs *HeightVoteSet) getVoteSet(round int, type_ byte) *types.VoteSet {
log.Debug("getVoteSet(round)", "round", round, "type", type_)
rvs, ok := hvs.roundVoteSets[round] rvs, ok := hvs.roundVoteSets[round]
if !ok { if !ok {
return nil return nil

View File

@ -313,7 +313,7 @@ func (conR *ConsensusReactor) sendNewRoundStepMessage(peer *p2p.Peer) {
} }
func (conR *ConsensusReactor) gossipDataRoutine(peer *p2p.Peer, ps *PeerState) { func (conR *ConsensusReactor) gossipDataRoutine(peer *p2p.Peer, ps *PeerState) {
log := log.New("peer", peer.Key) log := log.New("peer", peer)
OUTER_LOOP: OUTER_LOOP:
for { for {
@ -419,7 +419,7 @@ OUTER_LOOP:
} }
func (conR *ConsensusReactor) gossipVotesRoutine(peer *p2p.Peer, ps *PeerState) { 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. // Simple hack to throttle logs upon sleep.
var sleeping = 0 var sleeping = 0
@ -441,8 +441,8 @@ OUTER_LOOP:
sleeping = 0 sleeping = 0
} }
log.Debug("gossipVotesRoutine", "rsHeight", rs.Height, "rsRound", rs.Round, //log.Debug("gossipVotesRoutine", "rsHeight", rs.Height, "rsRound", rs.Round,
"prsHeight", prs.Height, "prsRound", prs.Round, "prsStep", prs.Step) // "prsHeight", prs.Height, "prsRound", prs.Round, "prsStep", prs.Step)
// If height matches, then send LastCommit, Prevotes, Precommits. // If height matches, then send LastCommit, Prevotes, Precommits.
if rs.Height == prs.Height { 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) { 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 { if type_ != types.VoteTypePrevote && type_ != types.VoteTypePrecommit {
PanicSanity("Invalid vote type") PanicSanity("Invalid vote type")
} }