forked from TrueCloudLab/frostfs-node
d772e35aba
Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
26 lines
465 B
Go
26 lines
465 B
Go
package loggerconfig
|
|
|
|
import (
|
|
"github.com/nspcc-dev/neofs-node/cmd/neofs-node/config"
|
|
)
|
|
|
|
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
|
|
}
|