json

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Encoder

type Encoder struct {
	// contains filtered or unexported fields
}

Encoder encodes log messages in logstash json format

func NewEncoder

func NewEncoder(cfg zapcore.EncoderConfig) *Encoder

NewEncoder returns a json Encoder

func (*Encoder) AddArray

func (e *Encoder) AddArray(key string, marshaler zapcore.ArrayMarshaler) error

func (*Encoder) AddBinary

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

func (*Encoder) AddBool

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

func (*Encoder) AddByteString

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

func (*Encoder) AddComplex128

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

func (*Encoder) AddComplex64

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

func (*Encoder) AddDuration

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

func (*Encoder) AddFloat32

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

func (*Encoder) AddFloat64

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

func (*Encoder) AddInt

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

func (*Encoder) AddInt16

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

func (*Encoder) AddInt32

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

func (*Encoder) AddInt64

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

func (*Encoder) AddInt8

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

func (*Encoder) AddObject

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

func (*Encoder) AddReflected

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

func (*Encoder) AddString

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

func (*Encoder) AddTime

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

func (*Encoder) AddUint

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

func (*Encoder) AddUint16

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

func (*Encoder) AddUint32

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

func (*Encoder) AddUint64

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

func (*Encoder) AddUint8

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

func (*Encoder) AddUintptr

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

func (*Encoder) Clone

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

Clone implements the zapcore Encoder interface

func (*Encoder) EncodeEntry

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

EncodeEntry encodes the log entry in logstash json format

func (*Encoder) OpenNamespace

func (e *Encoder) OpenNamespace(key string)

Jump to

Keyboard shortcuts

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