Skip to content

Commit

Permalink
Merge pull request #366 from aergoio/feat/improveP2pLog
Browse files Browse the repository at this point in the history
Adjust levels of some p2p logs
  • Loading branch information
kroggen authored Oct 15, 2024
2 parents f57688a + f404d54 commit fbd352b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion p2p/remotepeer.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ READNOPLOOP:
}
}

p.logger.Info().Str(p2putil.LogPeerName, p.Name()).Msg("Finishing peer")
p.logger.Debug().Str(p2putil.LogPeerName, p.Name()).Msg("Finishing peer")
txNoticeTicker.Stop()
pingTicker.Stop()
// finish goroutine write. read goroutine will be closed automatically when disconnect
Expand Down
4 changes: 2 additions & 2 deletions p2p/waitpeermanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ func (dpm *basePeerManager) getStream(meta p2pcommon.PeerMeta) (network.Stream,
func (dpm *basePeerManager) tryAddPeer(outbound bool, meta p2pcommon.PeerMeta, s network.Stream, h p2pcommon.HSHandler) (p2pcommon.PeerMeta, bool) {
hResult, err := h.Handle(s, defaultHandshakeTTL)
if err != nil {
dpm.logger.Debug().Err(err).Bool("outbound", outbound).Stringer(p2putil.LogPeerID, types.LogPeerShort(meta.ID)).Msg("Failed to handshake")
dpm.logger.Info().Err(err).Bool("outbound", outbound).Stringer(p2putil.LogPeerID, types.LogPeerShort(meta.ID)).Msg("Failed to handshake")
return meta, false
}

Expand Down Expand Up @@ -254,7 +254,7 @@ func (dpm *basePeerManager) OnWorkDone(result p2pcommon.ConnWorkResult) {
delete(dpm.workingJobs, meta.ID)
wp, ok := dpm.pm.waitingPeers[meta.ID]
if !ok {
dpm.logger.Debug().Str(p2putil.LogPeerName, p2putil.ShortMetaForm(meta)).Err(result.Result).Msg("Connection job finished")
dpm.logger.Info().Str(p2putil.LogPeerName, p2putil.ShortMetaForm(meta)).Err(result.Result).Msg("Connection job finished")
return
} else {
dpm.logger.Debug().Str(p2putil.LogPeerName, p2putil.ShortMetaForm(meta)).Int("trial", wp.TrialCnt).Err(result.Result).Msg("Connection job finished")
Expand Down

0 comments on commit fbd352b

Please sign in to comment.