Browse Source

logs: cleanup (#6198)

pull/6215/head
Marko 4 years ago
committed by GitHub
parent
commit
8c539f7c2b
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 20 deletions
  1. +5
    -6
      consensus/state.go
  2. +5
    -5
      mempool/clist_mempool.go
  3. +4
    -8
      p2p/shim.go
  4. +1
    -1
      rpc/jsonrpc/server/http_json_handler.go

+ 5
- 6
consensus/state.go View File

@ -1147,8 +1147,7 @@ func (cs *State) defaultDecideProposal(height int64, round int32) {
cs.sendInternalMessage(msgInfo{&BlockPartMessage{cs.Height, cs.Round, part}, ""})
}
cs.Logger.Info("signed proposal", "height", height, "round", round, "proposal", proposal)
cs.Logger.Debug("signed proposal block", "block", block)
cs.Logger.Debug("signed proposal", "height", height, "round", round, "proposal", proposal)
} else if !cs.replayMode {
cs.Logger.Error("propose step; failed signing proposal", "height", height, "round", round, "err", err)
}
@ -1661,7 +1660,7 @@ func (cs *State) finalizeCommit(height int64) {
if err != nil {
logger.Error("failed to prune blocks", "retain_height", retainHeight, "err", err)
} else {
logger.Info("pruned blocks", "pruned", pruned, "retain_height", retainHeight)
logger.Debug("pruned blocks", "pruned", pruned, "retain_height", retainHeight)
}
}
@ -1960,7 +1959,7 @@ func (cs *State) tryAddVote(vote *types.Vote, peerID p2p.NodeID) (bool, error) {
// report conflicting votes to the evidence pool
cs.evpool.ReportConflictingVotes(voteErr.VoteA, voteErr.VoteB)
cs.Logger.Info(
cs.Logger.Debug(
"found and sent conflicting votes to the evidence pool",
"vote_a", voteErr.VoteA,
"vote_b", voteErr.VoteB,
@ -2124,7 +2123,7 @@ func (cs *State) addVote(vote *types.Vote, peerID p2p.NodeID) (added bool, err e
case tmproto.PrecommitType:
precommits := cs.Votes.Precommits(vote.Round)
cs.Logger.Info("added vote to precommit", "vote", vote, "precommits", precommits.StringShort())
cs.Logger.Debug("added vote to precommit", "vote", vote, "precommits", precommits.StringShort())
blockID, ok := precommits.TwoThirdsMajority()
if ok {
@ -2233,7 +2232,7 @@ func (cs *State) signAddVote(msgType tmproto.SignedMsgType, hash []byte, header
vote, err := cs.signVote(msgType, hash, header)
if err == nil {
cs.sendInternalMessage(msgInfo{&VoteMessage{vote}, ""})
cs.Logger.Info("signed and pushed vote", "height", cs.Height, "round", cs.Round, "vote", vote)
cs.Logger.Debug("signed and pushed vote", "height", cs.Height, "round", cs.Round, "vote", vote)
return vote
}


+ 5
- 5
mempool/clist_mempool.go View File

@ -441,7 +441,7 @@ func (mem *CListMempool) resCbFirstTime(
}
memTx.senders.Store(peerID, true)
mem.addTx(memTx)
mem.logger.Info("Added good transaction",
mem.logger.Debug("added good transaction",
"tx", txID(tx),
"res", r,
"height", memTx.height,
@ -450,7 +450,7 @@ func (mem *CListMempool) resCbFirstTime(
mem.notifyTxsAvailable()
} else {
// ignore bad transaction
mem.logger.Info("Rejected bad transaction",
mem.logger.Debug("rejected bad transaction",
"tx", txID(tx), "peerID", peerP2PID, "res", r, "err", postCheckErr)
mem.metrics.FailedTxs.Add(1)
if !mem.config.KeepInvalidTxsInCache {
@ -486,7 +486,7 @@ func (mem *CListMempool) resCbRecheck(req *abci.Request, res *abci.Response) {
// Good, nothing to do.
} else {
// Tx became invalidated due to newly committed block.
mem.logger.Info("Tx is no longer valid", "tx", txID(tx), "res", r, "err", postCheckErr)
mem.logger.Debug("tx is no longer valid", "tx", txID(tx), "res", r, "err", postCheckErr)
// NOTE: we remove tx from the cache because it might be good later
mem.removeTx(tx, mem.recheckCursor, !mem.config.KeepInvalidTxsInCache)
}
@ -497,7 +497,7 @@ func (mem *CListMempool) resCbRecheck(req *abci.Request, res *abci.Response) {
}
if mem.recheckCursor == nil {
// Done!
mem.logger.Info("Done rechecking txs")
mem.logger.Debug("done rechecking txs")
// incase the recheck removed all txs
if mem.Size() > 0 {
@ -626,7 +626,7 @@ func (mem *CListMempool) Update(
// or just notify there're some txs left.
if mem.Size() > 0 {
if mem.config.Recheck {
mem.logger.Info("Recheck txs", "numtxs", mem.Size(), "height", height)
mem.logger.Debug("recheck txs", "numtxs", mem.Size(), "height", height)
mem.recheckTxs()
// At this point, mem.txs are being rechecked.
// mem.recheckCursor re-scans mem.txs and possibly removes some txs.


+ 4
- 8
p2p/shim.go View File

@ -110,7 +110,6 @@ func (rs *ReactorShim) proxyPeerEnvelopes() {
rs.Logger.Error(
"failed to proxy envelope; failed to wrap message",
"ch_id", cs.Descriptor.ID,
"msg", e.Message,
"err", err,
)
continue
@ -124,7 +123,6 @@ func (rs *ReactorShim) proxyPeerEnvelopes() {
rs.Logger.Error(
"failed to proxy envelope; failed to encode message",
"ch_id", cs.Descriptor.ID,
"msg", e.Message,
"err", err,
)
continue
@ -140,7 +138,6 @@ func (rs *ReactorShim) proxyPeerEnvelopes() {
rs.Logger.Debug(
"failed to proxy envelope; failed to find peer",
"ch_id", cs.Descriptor.ID,
"msg", e.Message,
"peer", e.To,
)
continue
@ -150,13 +147,12 @@ func (rs *ReactorShim) proxyPeerEnvelopes() {
rs.Logger.Error(
"failed to proxy message to peer",
"ch_id", cs.Descriptor.ID,
"msg", e.Message,
"peer", e.To,
)
}
default:
rs.Logger.Error("failed to proxy envelope; missing peer ID", "ch_id", cs.Descriptor.ID, "msg", e.Message)
rs.Logger.Error("failed to proxy envelope; missing peer ID", "ch_id", cs.Descriptor.ID)
}
}
}(cs)
@ -294,7 +290,7 @@ func (rs *ReactorShim) Receive(chID byte, src Peer, msgBytes []byte) {
msg.Reset()
if err := proto.Unmarshal(msgBytes, msg); err != nil {
rs.Logger.Error("error decoding message", "peer", src, "ch_id", cID, "msg", msg, "err", err)
rs.Logger.Error("error decoding message", "peer", src, "ch_id", cID, "err", err)
rs.Switch.StopPeerForError(src, err)
return
}
@ -302,7 +298,7 @@ func (rs *ReactorShim) Receive(chID byte, src Peer, msgBytes []byte) {
validator, ok := msg.(messageValidator)
if ok {
if err := validator.Validate(); err != nil {
rs.Logger.Error("invalid message", "peer", src, "ch_id", cID, "msg", msg, "err", err)
rs.Logger.Error("invalid message", "peer", src, "ch_id", cID, "err", err)
rs.Switch.StopPeerForError(src, err)
return
}
@ -314,7 +310,7 @@ func (rs *ReactorShim) Receive(chID byte, src Peer, msgBytes []byte) {
msg, err = wrapper.Unwrap()
if err != nil {
rs.Logger.Error("failed to unwrap message", "peer", src, "ch_id", chID, "msg", msg, "err", err)
rs.Logger.Error("failed to unwrap message", "peer", src, "ch_id", chID, "err", err)
return
}
}


+ 1
- 1
rpc/jsonrpc/server/http_json_handler.go View File

@ -99,7 +99,7 @@ func makeJSONRPCHandler(funcMap map[string]*RPCFunc, logger log.Logger) http.Han
}
returns := rpcFunc.f.Call(args)
logger.Debug("HTTPJSONRPC", "method", request.Method, "args", args, "returns", returns)
result, err := unreflectResult(returns)
switch e := err.(type) {
// if no error then return a success response


Loading…
Cancel
Save