Fix critical log level

The CRITICAL log level no longer exists and we were logging more than we
wanted to.
This commit is contained in:
Hector Sanjuan 2022-02-15 19:38:33 +01:00
parent 3ffaf0fcc7
commit d0e905babe
2 changed files with 17 additions and 9 deletions

View File

@ -54,7 +54,7 @@ var (
// number of pins to pin/unpin/check // number of pins to pin/unpin/check
nPins = 100 nPins = 100
logLevel = "CRITICAL" logLevel = "FATAL"
customLogLvlFacilities = logFacilities{} customLogLvlFacilities = logFacilities{}
consensus = "crdt" consensus = "crdt"

View File

@ -36,9 +36,9 @@ var LoggingFacilities = map[string]string{
// used in ipfs-cluster dependencies, which may be useful // used in ipfs-cluster dependencies, which may be useful
// to display. Along with their default value. // to display. Along with their default value.
var LoggingFacilitiesExtra = map[string]string{ var LoggingFacilitiesExtra = map[string]string{
"p2p-gorpc": "CRITICAL", "p2p-gorpc": "FATAL",
"swarm2": "ERROR", "swarm2": "ERROR",
"libp2p-raft": "CRITICAL", "libp2p-raft": "FATAL",
"raftlib": "ERROR", "raftlib": "ERROR",
"badger": "INFO", "badger": "INFO",
} }
@ -46,12 +46,20 @@ var LoggingFacilitiesExtra = map[string]string{
// SetFacilityLogLevel sets the log level for a given module // SetFacilityLogLevel sets the log level for a given module
func SetFacilityLogLevel(f, l string) { func SetFacilityLogLevel(f, l string) {
/* /*
CRITICAL Level = iota case "debug", "DEBUG":
ERROR *l = DebugLevel
WARNING case "info", "INFO", "": // make the zero value useful
NOTICE *l = InfoLevel
INFO case "warn", "WARN":
DEBUG *l = WarnLevel
case "error", "ERROR":
*l = ErrorLevel
case "dpanic", "DPANIC":
*l = DPanicLevel
case "panic", "PANIC":
*l = PanicLevel
case "fatal", "FATAL":
*l = FatalLevel
*/ */
logging.SetLogLevel(f, l) logging.SetLogLevel(f, l)
} }