Switch Down Libp2p Logging Level By Default (#11266)

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
This commit is contained in:
Nishant Das 2022-08-19 21:09:29 +08:00 committed by GitHub
parent 56c48b4971
commit 029c81a2e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -231,6 +231,13 @@ func startNode(ctx *cli.Context) error {
return err
}
logrus.SetLevel(level)
// Set libp2p logger to only panic logs for the info level.
golog.SetAllLoggers(golog.LevelPanic)
if level == logrus.DebugLevel {
// Set libp2p logger to error logs for the debug level.
golog.SetAllLoggers(golog.LevelError)
}
if level == logrus.TraceLevel {
// libp2p specific logging.
golog.SetAllLoggers(golog.LevelDebug)