Documentation ¶
Overview ¶
Package zapkc contains internal code copied from zap that we need to adjust slightly but can't import
Index ¶
- Constants
- Variables
- func CapitalColorLevelEncoder(l zapcore.Level, enc zapcore.PrimitiveArrayEncoder)
- func FormatEntryCaller(path string, maxLen int) []byte
- func NameEncoder(color Color) zapcore.NameEncoder
- func ShortCallerEncoder(caller zapcore.EntryCaller, enc zapcore.PrimitiveArrayEncoder)
- type Color
Constants ¶
View Source
const ( Black termColor = iota + 30 Red Green Yellow Blue Magenta Cyan White )
Foreground colors.
Variables ¶
View Source
var NoColor noColor
View Source
var UseColor = true
Functions ¶
func CapitalColorLevelEncoder ¶
func CapitalColorLevelEncoder(l zapcore.Level, enc zapcore.PrimitiveArrayEncoder)
CapitalColorLevelEncoder serializes a Level to an all-caps string and adds color. For example, InfoLevel is serialized to "INFO" and colored blue.
func FormatEntryCaller ¶
FormatEntryCaller formats a zapcore.EntryCaller to be displayed optimally given a maximum length. See test cases for examples.
Finally, my bachelor's degree in CS is put to use. Knew it would come in handy some day.
func NameEncoder ¶
func NameEncoder(color Color) zapcore.NameEncoder
func ShortCallerEncoder ¶
func ShortCallerEncoder(caller zapcore.EntryCaller, enc zapcore.PrimitiveArrayEncoder)
Types ¶
Click to show internal directories.
Click to hide internal directories.