MCPcopy
hub / github.com/sirupsen/logrus / UnmarshalText

Method UnmarshalText

logrus.go:50–59  ·  view source on GitHub ↗

UnmarshalText implements encoding.TextUnmarshaler.

(text []byte)

Source from the content-addressed store, hash-verified

48
49// UnmarshalText implements encoding.TextUnmarshaler.
50func (level *Level) UnmarshalText(text []byte) error {
51 l, err := ParseLevel(string(text))
52 if err != nil {
53 return err
54 }
55
56 *level = l
57
58 return nil
59}
60
61func (level Level) MarshalText() ([]byte, error) {
62 switch level {

Callers 2

TestLevelUnmarshalTextFunction · 0.95
TestLevelMarshalTextFunction · 0.95

Calls 1

ParseLevelFunction · 0.85

Tested by 2

TestLevelUnmarshalTextFunction · 0.76
TestLevelMarshalTextFunction · 0.76