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

Method MarshalText

zapcore/level.go:160–162  ·  view source on GitHub ↗

MarshalText marshals the Level to text. Note that the text representation drops the -Level suffix (see example).

()

Source from the content-addressed store, hash-verified

158// MarshalText marshals the Level to text. Note that the text representation
159// drops the -Level suffix (see example).
160func (l Level) MarshalText() ([]byte, error) {
161 return []byte(l.String()), nil
162}
163
164// UnmarshalText unmarshals text to a level. Like MarshalText, UnmarshalText
165// expects the text representation of a Level to drop the -Level suffix (see

Callers 2

TestLevelNilsFunction · 0.95
TestLevelTextFunction · 0.45

Calls 1

StringMethod · 0.95

Tested by 2

TestLevelNilsFunction · 0.76
TestLevelTextFunction · 0.36