frostfs-node/cmd/neofs-node/config/logger/config.go
Elizaveta Chichindaeva cc7a723d77 [#1320] English Check
Signed-off-by: Elizaveta Chichindaeva <elizaveta@nspcc.ru>
2022-05-11 10:40:02 +03:00

27 lines
484 B
Go

package loggerconfig
import (
"github.com/nspcc-dev/neofs-node/cmd/neofs-node/config"
)
// config defaults
const (
// LevelDefault is a default logger level.
LevelDefault = "info"
)
// Level returns the value of "level" config parameter
// from "logger" section.
//
// Returns LevelDefault if the value is not a non-empty string.
func Level(c *config.Config) string {
v := config.StringSafe(
c.Sub("logger"),
"level",
)
if v != "" {
return v
}
return LevelDefault
}