MCPcopy
hub / github.com/uber-go/zap / unmarshalText

Method unmarshalText

zapcore/level.go:180–200  ·  view source on GitHub ↗
(text []byte)

Source from the content-addressed store, hash-verified

178}
179
180func (l *Level) unmarshalText(text []byte) bool {
181 switch string(text) {
182 case "debug":
183 *l = DebugLevel
184 case "info", "": // make the zero value useful
185 *l = InfoLevel
186 case "warn", "warning":
187 *l = WarnLevel
188 case "error":
189 *l = ErrorLevel
190 case "dpanic":
191 *l = DPanicLevel
192 case "panic":
193 *l = PanicLevel
194 case "fatal":
195 *l = FatalLevel
196 default:
197 return false
198 }
199 return true
200}
201
202// Set sets the level for the flag.Value interface.
203func (l *Level) Set(s string) error {

Callers 1

UnmarshalTextMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected