MCPcopy
hub / github.com/netdata/netdata / SetByName

Method SetByName

src/go/logger/level.go:38–54  ·  view source on GitHub ↗
(level string)

Source from the content-addressed store, hash-verified

36}
37
38func (l *level) SetByName(level string) {
39 // https://github.com/netdata/netdata/tree/master/src/libnetdata/log#log-levels
40 switch strings.ToLower(level) {
41 case "err", "error":
42 l.lvl.Set(slog.LevelError)
43 case "warn", "warning":
44 l.lvl.Set(slog.LevelWarn)
45 case "notice":
46 l.lvl.Set(levelNotice)
47 case "info":
48 l.lvl.Set(slog.LevelInfo)
49 case "debug":
50 l.lvl.Set(slog.LevelDebug)
51 case "emergency", "alert", "critical":
52 l.lvl.Set(levelDisable)
53 }
54}

Callers 3

mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80

Calls 1

SetMethod · 0.65

Tested by

no test coverage detected