Skip to content

Commit

Permalink
fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
algorandskiy committed Jun 24, 2024
1 parent b5ce190 commit 4067026
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions network/p2p/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ type loggingCore struct {
zapcore.Core
}

// ErrInvalidLogLevel is returned when an invalid log level is provided.
var ErrInvalidLogLevel = errors.New("invalid log level")

// EnableP2PLogging enables libp2p logging into the provided logger with the provided level.
Expand All @@ -71,6 +72,7 @@ func EnableP2PLogging(log logging.Logger, l logging.Level) error {
return nil
}

// SetP2PLogLevel sets the log level for libp2p logging.
func SetP2PLogLevel(l logging.Level) error {
var seen bool
for p2pLevel, logLevel := range levelsMap {
Expand Down
2 changes: 1 addition & 1 deletion network/p2pNetwork.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ func (n *P2PNetwork) Stop() {
// PubSub.processLoop goroutine finishes logging its termination message
// to already closed logger. Not seen in wild, only in tests.
if n.log.GetLevel() >= logging.Warn {
p2p.SetP2PLogLevel(logging.Warn)
_ = p2p.SetP2PLogLevel(logging.Warn)
}
n.ctxCancel()

Expand Down

0 comments on commit 4067026

Please sign in to comment.