MCPcopy Index your code
hub / github.com/uber-go/zap / CapitalColorLevelEncoder

Function CapitalColorLevelEncoder

zapcore/encoder.go:69–75  ·  view source on GitHub ↗

CapitalColorLevelEncoder serializes a Level to an all-caps string and adds color. For example, InfoLevel is serialized to "INFO" and colored blue.

(l Level, enc PrimitiveArrayEncoder)

Source from the content-addressed store, hash-verified

67// CapitalColorLevelEncoder serializes a Level to an all-caps string and adds color.
68// For example, InfoLevel is serialized to "INFO" and colored blue.
69func CapitalColorLevelEncoder(l Level, enc PrimitiveArrayEncoder) {
70 s, ok := _levelToCapitalColorString[l]
71 if !ok {
72 s = _unknownLevelColor.Add(l.CapitalString())
73 }
74 enc.AppendString(s)
75}
76
77// UnmarshalText unmarshals text to a LevelEncoder. "capital" is unmarshaled to
78// CapitalLevelEncoder, "coloredCapital" is unmarshaled to CapitalColorLevelEncoder,

Callers

nothing calls this directly

Calls 3

CapitalStringMethod · 0.80
AppendStringMethod · 0.65
AddMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…