Merge pull request #1117 from filecoin-project/fix/dont-override-loglvl

lotuslog: Don't override log levels
This commit is contained in:
Łukasz Magiera 2020-01-19 21:38:36 +01:00 committed by GitHub
commit 4436148fa1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,12 +1,18 @@
package lotuslog
import logging "github.com/ipfs/go-log/v2"
import (
"os"
logging "github.com/ipfs/go-log/v2"
)
func SetupLogLevels() {
logging.SetLogLevel("*", "INFO")
logging.SetLogLevel("dht", "ERROR")
logging.SetLogLevel("swarm2", "WARN")
logging.SetLogLevel("bitswap", "WARN")
logging.SetLogLevel("pubsub", "WARN")
logging.SetLogLevel("connmgr", "WARN")
if _, set := os.LookupEnv("GOLOG_LOG_LEVEL"); !set {
logging.SetLogLevel("*", "INFO")
logging.SetLogLevel("dht", "ERROR")
logging.SetLogLevel("swarm2", "WARN")
logging.SetLogLevel("bitswap", "WARN")
logging.SetLogLevel("pubsub", "WARN")
logging.SetLogLevel("connmgr", "WARN")
}
}