Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUnsupportedValueType = errors.New("unsupported value type")
Functions ¶
func NewEncoder ¶
func NewEncoder(cfg zapcore.EncoderConfig, opts ...Option) zapcore.Encoder
NewEncoder return a new encoder.
Types ¶
type Option ¶ added in v1.4.0
type Option func(*config)
Option is a function which can be used to modify the default custom config.
func WithAlternativeCallerEncoder ¶ added in v1.4.0
func WithAlternativeCallerEncoder(encoder zapcore.CallerEncoder) Option
WithAlternativeCallerEncoder sets the caller encoder for logs which are less than the caller level. e.g. If set to the ShortCallerEncoder, the caller is still logged for logs which are less than the caller level using the abbreviated format.
func WithCallerLevel ¶ added in v1.4.0
WithCallerLevel sets the minimum log level for which the caller is logged. e.g. If it is set to WarnLevel the caller will be logged for only WarnLevel and above logs.
Click to show internal directories.
Click to hide internal directories.