Documentation
¶
Index ¶
- Constants
- func LevelToShortName(level zapcore.Level) string
- func NewPrettyLogger(encoderConfig *zapcore.EncoderConfig, level zapcore.Level) *zap.Logger
- type Encoder
- func (p *Encoder) AddArray(key string, marshaler zapcore.ArrayMarshaler) error
- func (p *Encoder) AddBinary(key string, value []byte)
- func (p *Encoder) AddBool(key string, value bool)
- func (p *Encoder) AddByteString(key string, value []byte)
- func (p *Encoder) AddComplex128(key string, value complex128)
- func (p *Encoder) AddComplex64(key string, value complex64)
- func (p *Encoder) AddDuration(key string, value time.Duration)
- func (p *Encoder) AddFloat32(key string, value float32)
- func (p *Encoder) AddFloat64(key string, value float64)
- func (p *Encoder) AddInt(key string, value int)
- func (p *Encoder) AddInt16(key string, value int16)
- func (p *Encoder) AddInt32(key string, value int32)
- func (p *Encoder) AddInt64(key string, value int64)
- func (p *Encoder) AddInt8(key string, value int8)
- func (p *Encoder) AddObject(key string, marshaler zapcore.ObjectMarshaler) error
- func (p *Encoder) AddReflected(key string, value interface{}) error
- func (p *Encoder) AddString(key, value string)
- func (p *Encoder) AddTime(key string, value time.Time)
- func (p *Encoder) AddUint(key string, value uint)
- func (p *Encoder) AddUint16(key string, value uint16)
- func (p *Encoder) AddUint32(key string, value uint32)
- func (p *Encoder) AddUint64(key string, value uint64)
- func (p *Encoder) AddUint8(key string, value uint8)
- func (p *Encoder) AddUintptr(key string, value uintptr)
- func (p *Encoder) AppendArray(marshaler zapcore.ArrayMarshaler) error
- func (p *Encoder) AppendBool(b bool)
- func (p *Encoder) AppendByteString(bytes []byte)
- func (p *Encoder) AppendComplex128(c complex128)
- func (p *Encoder) AppendComplex64(c complex64)
- func (p *Encoder) AppendDuration(duration time.Duration)
- func (p *Encoder) AppendFloat32(f float32)
- func (p *Encoder) AppendFloat64(f float64)
- func (p *Encoder) AppendInt(i int)
- func (p *Encoder) AppendInt16(i int16)
- func (p *Encoder) AppendInt32(i int32)
- func (p *Encoder) AppendInt64(i int64)
- func (p *Encoder) AppendInt8(i int8)
- func (p *Encoder) AppendObject(marshaler zapcore.ObjectMarshaler) error
- func (p *Encoder) AppendReflected(value interface{}) error
- func (p *Encoder) AppendString(s string)
- func (p *Encoder) AppendTerminal(e EscapeCodes)
- func (p *Encoder) AppendTime(t time.Time)
- func (p *Encoder) AppendUint(u uint)
- func (p *Encoder) AppendUint16(u uint16)
- func (p *Encoder) AppendUint32(u uint32)
- func (p *Encoder) AppendUint64(u uint64)
- func (p *Encoder) AppendUint8(u uint8)
- func (p *Encoder) AppendUintptr(u uintptr)
- func (p *Encoder) Clone() zapcore.Encoder
- func (p *Encoder) EncodeEntry(entry zapcore.Entry, fields []zapcore.Field) (*buffer.Buffer, error)
- func (p *Encoder) OpenNamespace(key string)
- type EncoderPool
- type EscapeCodes
- type PrettyLogger
Constants ¶
View Source
const ( Black EscapeCodes = "\x1b[30m" Red = "\x1b[31m" Green = "\x1b[32m" Yellow = "\x1b[33m" Blue = "\x1b[34m" Magenta = "\x1b[35m" Cyan = "\x1b[36m" White = "\x1b[37m" Clear = "\x1b[0m" Bold = "\x1b[1m" )
Foreground colors.
Variables ¶
This section is empty.
Functions ¶
func LevelToShortName ¶ added in v0.0.5
func NewPrettyLogger ¶
Types ¶
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
func (*Encoder) AddArray ¶
func (p *Encoder) AddArray(key string, marshaler zapcore.ArrayMarshaler) error
func (*Encoder) AddByteString ¶
func (*Encoder) AddComplex128 ¶
func (p *Encoder) AddComplex128(key string, value complex128)
func (*Encoder) AddComplex64 ¶
func (*Encoder) AddFloat32 ¶
func (*Encoder) AddFloat64 ¶
func (*Encoder) AddObject ¶
func (p *Encoder) AddObject(key string, marshaler zapcore.ObjectMarshaler) error
func (*Encoder) AddReflected ¶
func (*Encoder) AddUintptr ¶
func (*Encoder) AppendArray ¶
func (p *Encoder) AppendArray(marshaler zapcore.ArrayMarshaler) error
func (*Encoder) AppendBool ¶
func (*Encoder) AppendByteString ¶
func (*Encoder) AppendComplex128 ¶
func (p *Encoder) AppendComplex128(c complex128)
func (*Encoder) AppendComplex64 ¶
func (*Encoder) AppendDuration ¶
func (*Encoder) AppendFloat32 ¶
func (*Encoder) AppendFloat64 ¶
func (*Encoder) AppendInt16 ¶
func (*Encoder) AppendInt32 ¶
func (*Encoder) AppendInt64 ¶
func (*Encoder) AppendInt8 ¶
func (*Encoder) AppendObject ¶
func (p *Encoder) AppendObject(marshaler zapcore.ObjectMarshaler) error
func (*Encoder) AppendReflected ¶
func (*Encoder) AppendString ¶
func (*Encoder) AppendTerminal ¶ added in v0.0.11
func (p *Encoder) AppendTerminal(e EscapeCodes)
func (*Encoder) AppendTime ¶
func (*Encoder) AppendUint ¶
func (*Encoder) AppendUint16 ¶
func (*Encoder) AppendUint32 ¶
func (*Encoder) AppendUint64 ¶
func (*Encoder) AppendUint8 ¶
func (*Encoder) AppendUintptr ¶
func (*Encoder) EncodeEntry ¶
func (*Encoder) OpenNamespace ¶
type EncoderPool ¶ added in v0.0.12
type EncoderPool struct{}
func NewEncoderPool ¶ added in v0.0.12
func NewEncoderPool() *EncoderPool
func (*EncoderPool) Get ¶ added in v0.0.12
func (e *EncoderPool) Get() *Encoder
func (*EncoderPool) Put ¶ added in v0.0.12
func (e *EncoderPool) Put(enc *Encoder)
type EscapeCodes ¶
type EscapeCodes string
BrightColor represents a text color.
func ColorKey ¶
func ColorKey(level zapcore.Level) EscapeCodes
ColorKey will color the provided key at the associated log level color
type PrettyLogger ¶
type PrettyLogger struct {
*Encoder
}
Click to show internal directories.
Click to hide internal directories.