Documentation ¶
Overview ¶
Package z provides an API for structured logging fields by wrapping zap.Field. It also supports internal structured errors.
Index ¶
- Variables
- type Field
- func Any(key string, val interface{}) Field
- func Bool(key string, val bool) Field
- func Err(err error) Field
- func F64(key string, val float64) Field
- func Hex(key string, val []byte) Field
- func I64(key string, val int64) Field
- func Int(key string, val int) Field
- func Str(key, val string) Field
- func U64(key string, val uint64) Field
- func Uint(key string, val uint) Field
Constants ¶
This section is empty.
Variables ¶
View Source
var Skip = func(add func(zap.Field)) {}
Skip is a noop wrapped zap field similar to zap.Skip.
Functions ¶
This section is empty.
Types ¶
type Field ¶
Field wraps one or more zap fields.
func Any ¶
Any returns a wrapped zap string field with the string version of value. Note we are not using zap.Any since logfmt formatter doesn't support it.
func Err ¶
Err returns a wrapped zap error field. It will include an additional stack trace and fields if the error is an internal structured error. Note: This is only used when logging errors on other levels than Error since it has built-in support for errors.
Click to show internal directories.
Click to hide internal directories.