MCPcopy Index your code
hub / github.com/CodisLabs/codis / ParseFromString

Method ParseFromString

pkg/utils/log/log.go:85–101  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

83}
84
85func (l *LogLevel) ParseFromString(s string) bool {
86 switch strings.ToUpper(s) {
87 case "ERROR":
88 *l = LevelError
89 case "DEBUG":
90 *l = LevelDebug
91 case "WARN", "WARNING":
92 *l = LevelWarn
93 case "INFO":
94 *l = LevelInfo
95 case "NONE":
96 *l = LevelNone
97 default:
98 return false
99 }
100 return true
101}
102
103func (l *LogLevel) Set(v LogLevel) {
104 atomic.StoreInt64((*int64)(l), int64(v))

Callers 3

SetLevelStringMethod · 0.95
handleLogLevelMethod · 0.95
handleLogLevelMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected