Documentation ¶
Index ¶
- func New(options ...Option) zap.Encoder
- type Buffer
- type Encoder
- func (enc *Encoder) AddBool(key string, value bool)
- func (enc *Encoder) AddFloat64(key string, value float64)
- func (enc *Encoder) AddInt(key string, value int)
- func (enc *Encoder) AddInt64(key string, value int64)
- func (enc *Encoder) AddMarshaler(key string, marshaler zap.LogMarshaler) error
- func (enc *Encoder) AddObject(key string, value interface{}) error
- func (enc *Encoder) AddString(key, value string)
- func (enc *Encoder) AddUint(key string, value uint)
- func (enc *Encoder) AddUint64(key string, value uint64)
- func (enc *Encoder) Clone() zap.Encoder
- func (enc *Encoder) Free()
- func (enc *Encoder) WriteEntry(w io.Writer, message string, level zap.Level, time time.Time) error
- type FixedWidthMessageFormatterOption
- type LayoutTimeFormatterOption
- type LevelFormatter
- type LevelMap
- type LevelMapFormatterOption
- type MessageFormatter
- type NoLevelFormatterOption
- type NoTimeFormatterOption
- type Option
- type SimpleMessageFormatterOption
- type TimeFormatter
- type UnixNanoTimeFormatterOption
- type UnixTimeFormatterOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
Buffer is a byte buffer
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
Encoder is zap.Encoder implementation that writes plain text messages
func (*Encoder) AddFloat64 ¶
AddFloat64 ...
func (*Encoder) AddMarshaler ¶
func (enc *Encoder) AddMarshaler(key string, marshaler zap.LogMarshaler) error
AddMarshaler ...
type FixedWidthMessageFormatterOption ¶
type FixedWidthMessageFormatterOption struct {
// contains filtered or unexported fields
}
FixedWidthMessageFormatterOption is an option for fixed width log message format
func (FixedWidthMessageFormatterOption) Apply ¶
func (f FixedWidthMessageFormatterOption) Apply(e *Encoder)
Apply option to encoder
type LayoutTimeFormatterOption ¶
type LayoutTimeFormatterOption struct {
// contains filtered or unexported fields
}
LayoutTimeFormatterOption is an option for log entry time formatting according to specified layout
func (LayoutTimeFormatterOption) Apply ¶
func (f LayoutTimeFormatterOption) Apply(e *Encoder)
Apply option to encoder
type LevelFormatter ¶
LevelFormatter is a func used to render log entry level
type LevelMapFormatterOption ¶
type LevelMapFormatterOption struct {
// contains filtered or unexported fields
}
LevelMapFormatterOption is an option for level formatting according to a mapping
func (LevelMapFormatterOption) Apply ¶
func (f LevelMapFormatterOption) Apply(e *Encoder)
Apply sets level formatter for an encoder
type MessageFormatter ¶
MessageFormatter is a func used to render log entry message
type NoLevelFormatterOption ¶
type NoLevelFormatterOption struct{}
NoLevelFormatterOption defines an option which makes encoder to skip log level
func (NoLevelFormatterOption) Apply ¶
func (f NoLevelFormatterOption) Apply(e *Encoder)
Apply sets level formatter for an encoder
type NoTimeFormatterOption ¶
type NoTimeFormatterOption struct{}
NoTimeFormatterOption defines an option which makes encoder to skip log level
func (NoTimeFormatterOption) Apply ¶
func (f NoTimeFormatterOption) Apply(e *Encoder)
Apply sets level formatter for an encoder
type Option ¶
type Option interface {
Apply(*Encoder)
}
Option is an Encoder option
func FixedWidthMessage ¶
FixedWidthMessage returns option for trimming/expanding log message to specified width
func SimpleColorLevel ¶
func SimpleColorLevel() Option
SimpleColorLevel formats log level as colored level names
func SimpleLevel ¶
func SimpleLevel() Option
SimpleLevel formats log level in most dull and unfancy way possible
func SimpleMessage ¶
func SimpleMessage() Option
SimpleMessage formats log message in most dull and unfancy way possible
type SimpleMessageFormatterOption ¶
type SimpleMessageFormatterOption struct{}
SimpleMessageFormatterOption is an option for simple log message format
func (SimpleMessageFormatterOption) Apply ¶
func (f SimpleMessageFormatterOption) Apply(e *Encoder)
Apply option to encoder
type TimeFormatter ¶
TimeFormatter is a func used to render log entry time
type UnixNanoTimeFormatterOption ¶
type UnixNanoTimeFormatterOption struct{}
UnixNanoTimeFormatterOption is an option for formatting entry time as nanoseconds since epoch
func (UnixNanoTimeFormatterOption) Apply ¶
func (f UnixNanoTimeFormatterOption) Apply(e *Encoder)
Apply option to encoder
type UnixTimeFormatterOption ¶
type UnixTimeFormatterOption struct{}
UnixTimeFormatterOption is an option for formatting entry time as seconds since epoch
func (UnixTimeFormatterOption) Apply ¶
func (f UnixTimeFormatterOption) Apply(e *Encoder)
Apply option to encoder