prettyzap

package module
v0.0.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2021 License: MIT Imports: 8 Imported by: 0

README

pretty-zap

Documentation

Index

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 LevelToShortName(level zapcore.Level) string

func NewPrettyLogger

func NewPrettyLogger(encoderConfig *zapcore.EncoderConfig, level zapcore.Level) *zap.Logger

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) AddBinary

func (p *Encoder) AddBinary(key string, value []byte)

func (*Encoder) AddBool

func (p *Encoder) AddBool(key string, value bool)

func (*Encoder) AddByteString

func (p *Encoder) AddByteString(key string, value []byte)

func (*Encoder) AddComplex128

func (p *Encoder) AddComplex128(key string, value complex128)

func (*Encoder) AddComplex64

func (p *Encoder) AddComplex64(key string, value complex64)

func (*Encoder) AddDuration

func (p *Encoder) AddDuration(key string, value time.Duration)

func (*Encoder) AddFloat32

func (p *Encoder) AddFloat32(key string, value float32)

func (*Encoder) AddFloat64

func (p *Encoder) AddFloat64(key string, value float64)

func (*Encoder) AddInt

func (p *Encoder) AddInt(key string, value int)

func (*Encoder) AddInt16

func (p *Encoder) AddInt16(key string, value int16)

func (*Encoder) AddInt32

func (p *Encoder) AddInt32(key string, value int32)

func (*Encoder) AddInt64

func (p *Encoder) AddInt64(key string, value int64)

func (*Encoder) AddInt8

func (p *Encoder) AddInt8(key string, value int8)

func (*Encoder) AddObject

func (p *Encoder) AddObject(key string, marshaler zapcore.ObjectMarshaler) error

func (*Encoder) AddReflected

func (p *Encoder) AddReflected(key string, value interface{}) error

func (*Encoder) AddString

func (p *Encoder) AddString(key, value string)

func (*Encoder) AddTime

func (p *Encoder) AddTime(key string, value time.Time)

func (*Encoder) AddUint

func (p *Encoder) AddUint(key string, value uint)

func (*Encoder) AddUint16

func (p *Encoder) AddUint16(key string, value uint16)

func (*Encoder) AddUint32

func (p *Encoder) AddUint32(key string, value uint32)

func (*Encoder) AddUint64

func (p *Encoder) AddUint64(key string, value uint64)

func (*Encoder) AddUint8

func (p *Encoder) AddUint8(key string, value uint8)

func (*Encoder) AddUintptr

func (p *Encoder) AddUintptr(key string, value uintptr)

func (*Encoder) AppendArray

func (p *Encoder) AppendArray(marshaler zapcore.ArrayMarshaler) error

func (*Encoder) AppendBool

func (p *Encoder) AppendBool(b bool)

func (*Encoder) AppendByteString

func (p *Encoder) AppendByteString(bytes []byte)

func (*Encoder) AppendComplex128

func (p *Encoder) AppendComplex128(c complex128)

func (*Encoder) AppendComplex64

func (p *Encoder) AppendComplex64(c complex64)

func (*Encoder) AppendDuration

func (p *Encoder) AppendDuration(duration time.Duration)

func (*Encoder) AppendFloat32

func (p *Encoder) AppendFloat32(f float32)

func (*Encoder) AppendFloat64

func (p *Encoder) AppendFloat64(f float64)

func (*Encoder) AppendInt

func (p *Encoder) AppendInt(i int)

func (*Encoder) AppendInt16

func (p *Encoder) AppendInt16(i int16)

func (*Encoder) AppendInt32

func (p *Encoder) AppendInt32(i int32)

func (*Encoder) AppendInt64

func (p *Encoder) AppendInt64(i int64)

func (*Encoder) AppendInt8

func (p *Encoder) AppendInt8(i int8)

func (*Encoder) AppendObject

func (p *Encoder) AppendObject(marshaler zapcore.ObjectMarshaler) error

func (*Encoder) AppendReflected

func (p *Encoder) AppendReflected(value interface{}) error

func (*Encoder) AppendString

func (p *Encoder) AppendString(s string)

func (*Encoder) AppendTerminal added in v0.0.11

func (p *Encoder) AppendTerminal(e EscapeCodes)

func (*Encoder) AppendTime

func (p *Encoder) AppendTime(t time.Time)

func (*Encoder) AppendUint

func (p *Encoder) AppendUint(u uint)

func (*Encoder) AppendUint16

func (p *Encoder) AppendUint16(u uint16)

func (*Encoder) AppendUint32

func (p *Encoder) AppendUint32(u uint32)

func (*Encoder) AppendUint64

func (p *Encoder) AppendUint64(u uint64)

func (*Encoder) AppendUint8

func (p *Encoder) AppendUint8(u uint8)

func (*Encoder) AppendUintptr

func (p *Encoder) AppendUintptr(u uintptr)

func (*Encoder) Clone

func (p *Encoder) Clone() zapcore.Encoder

func (*Encoder) EncodeEntry

func (p *Encoder) EncodeEntry(entry zapcore.Entry, fields []zapcore.Field) (*buffer.Buffer, error)

func (*Encoder) OpenNamespace

func (p *Encoder) OpenNamespace(key string)

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
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL