lotus/lib/lotuslog/levels.go
Jakub Sztandera b0cf3d3228
Mute RtRefreshManager logs as they break terminal emulation
RtRefreshManager logs random binary strings, which somtimes might be
partial multi-byte Unicode or ASCI escape codes.

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-07-09 16:21:55 +02:00

24 lines
668 B
Go

package lotuslog
import (
"os"
logging "github.com/ipfs/go-log/v2"
)
func SetupLogLevels() {
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")
_ = logging.SetLogLevel("advmgr", "DEBUG")
_ = logging.SetLogLevel("stores", "DEBUG")
_ = logging.SetLogLevel("nat", "INFO")
}
// Always mute RtRefreshManager because it breaks terminals
_ = logging.SetLogLevel("dht/RtRefreshManager", "FATAL")
}