Documentation ¶
Overview ¶
Package logger provides functions for setting up a zap logger with environment aware output.
Index ¶
- func FromConfig(c Config) *zap.Logger
- func MilliDurationEncoder(d time.Duration, e zapcore.PrimitiveArrayEncoder)
- func New(w zapcore.WriteSyncer) *zap.Logger
- func NewDevelopment() *zap.Logger
- func NewEncoder(c Config) (e zapcore.Encoder)
- func NewEncoderConfig(c Config) zapcore.EncoderConfig
- func NewProduction() *zap.Logger
- func RFC3339MilliTimeEncoder(t time.Time, e zapcore.PrimitiveArrayEncoder)
- type Config
- type Format
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromConfig ¶
FromConfig constructs a new logger using the given Config.
func MilliDurationEncoder ¶
func MilliDurationEncoder(d time.Duration, e zapcore.PrimitiveArrayEncoder)
MilliDurationEncoder encodes a time.Duration as milliseconds.
func New ¶
func New(w zapcore.WriteSyncer) *zap.Logger
New constructs a new logger at info level printing to the given output.
func NewDevelopment ¶
NewDevelopment creates a logger at debug level printing to stderr.
func NewEncoder ¶
NewEncoder constructs a new zapcore.Encoder using the given Config.
func NewEncoderConfig ¶
func NewEncoderConfig(c Config) zapcore.EncoderConfig
NewEncoderConfig constructs a new zapcore.EncoderConfig using the given Config.
func NewProduction ¶
NewProduction creates a new logger at info level printing to stderr.
func RFC3339MilliTimeEncoder ¶
func RFC3339MilliTimeEncoder(t time.Time, e zapcore.PrimitiveArrayEncoder)
RFC3339MilliTimeEncoder encodes a time.Time in RFC3339 format with millisecond precision.