UnmarshalText unmarshals the text to an AtomicLevel. It uses the same text representations as the static zapcore.Levels ("debug", "info", "warn", "error", "dpanic", "panic", and "fatal").
(text []byte)
| 132 | // representations as the static zapcore.Levels ("debug", "info", "warn", |
| 133 | // "error", "dpanic", "panic", and "fatal"). |
| 134 | func (lvl *AtomicLevel) UnmarshalText(text []byte) error { |
| 135 | if lvl.l == nil { |
| 136 | lvl.l = &atomic.Int32{} |
| 137 | } |
| 138 | |
| 139 | var l zapcore.Level |
| 140 | if err := l.UnmarshalText(text); err != nil { |
| 141 | return err |
| 142 | } |
| 143 | |
| 144 | lvl.SetLevel(l) |
| 145 | return nil |
| 146 | } |
| 147 | |
| 148 | // MarshalText marshals the AtomicLevel to a byte slice. It uses the same |
| 149 | // text representation as the static zapcore.Levels ("debug", "info", "warn", |