Versions in this module Expand all Collapse all v0 v0.0.1 Jul 4, 2020 Changes in this version + const DefaultLineEnding + func CapitalLevelEncoder(l Level, enc PrimitiveArrayEncoder) + func EpochMillisTimeEncoder(ns int64, enc PrimitiveArrayEncoder) + func EpochNanosTimeEncoder(ns int64, enc PrimitiveArrayEncoder) + func EpochTimeEncoder(ns int64, enc PrimitiveArrayEncoder) + func ISO8601TimeEncoder(ns int64, enc PrimitiveArrayEncoder) + func LowercaseLevelEncoder(l Level, enc PrimitiveArrayEncoder) + func NanosDurationEncoder(d time.Duration, enc PrimitiveArrayEncoder) + func SecondsDurationEncoder(d time.Duration, enc PrimitiveArrayEncoder) + func StringDurationEncoder(d time.Duration, enc PrimitiveArrayEncoder) + type ArrayEncoder interface + AppendArray func(ArrayMarshaler) error + AppendDuration func(time.Duration) + AppendObject func(ObjectMarshaler) error + AppendReflected func(value interface{}) error + AppendTime func(nsec int64) + type ArrayMarshaler interface + MarshalLogArray func(ArrayEncoder) error + type ArrayMarshalerFunc func(ArrayEncoder) error + func (f ArrayMarshalerFunc) MarshalLogArray(enc ArrayEncoder) error + type CheckWriteAction uint8 + const WriteThenFatal + const WriteThenNoop + const WriteThenPanic + type CheckedEntry struct + func (ce *CheckedEntry) AddCore(ent Entry, core Core) *CheckedEntry + func (ce *CheckedEntry) Should(ent Entry, should CheckWriteAction) *CheckedEntry + func (ce *CheckedEntry) Write(fields ...Field) + type Core interface + Check func(Entry, *CheckedEntry) *CheckedEntry + Sync func() error + With func([]Field) Core + Write func(Entry, []Field) error + func NewCore(enc Encoder, ws WriteSyncer, enab LevelEnabler) Core + type DurationEncoder func(time.Duration, PrimitiveArrayEncoder) + func (e *DurationEncoder) UnmarshalText(text []byte) error + type Encoder interface + Clone func() Encoder + EncodeEntry func(Entry, []Field) (*buffer.Buffer, error) + func NewJSONEncoder(cfg EncoderConfig) Encoder + type EncoderConfig struct + EncodeDuration DurationEncoder + EncodeLevel LevelEncoder + EncodeTime TimeEncoder + LevelKey string + LineEnding string + MessageKey string + ReqIDKey string + TimeKey string + type Entry struct + Level Level + Message string + ReqID string + Time int64 + type Field struct + Integer int64 + Interface interface{} + Key string + String string + Type FieldType + func (f Field) AddTo(enc ObjectEncoder) + func (f Field) Equals(other Field) bool + type FieldType uint8 + const ArrayMarshalerType + const BinaryType + const BoolType + const ByteStringType + const Complex128Type + const Complex64Type + const DurationType + const ErrorType + const Float32Type + const Float64Type + const Int16Type + const Int32Type + const Int64Type + const Int8Type + const NamespaceType + const ObjectMarshalerType + const ReflectType + const SkipType + const StringType + const StringerType + const TimeType + const Uint16Type + const Uint32Type + const Uint64Type + const Uint8Type + const UintptrType + const UnknownType + type Level int8 + const DPanicLevel + const DebugLevel + const ErrorLevel + const FatalLevel + const InfoLevel + const PanicLevel + const WarnLevel + func (l *Level) Get() interface{} + func (l *Level) Set(s string) error + func (l *Level) UnmarshalText(text []byte) error + func (l Level) CapitalString() string + func (l Level) Enabled(lvl Level) bool + func (l Level) MarshalText() ([]byte, error) + func (l Level) String() string + type LevelEnabler interface + Enabled func(Level) bool + type LevelEncoder func(Level, PrimitiveArrayEncoder) + func (e *LevelEncoder) UnmarshalText(text []byte) error + type MapObjectEncoder struct + Fields map[string]interface{} + func NewMapObjectEncoder() *MapObjectEncoder + func (m *MapObjectEncoder) AddArray(key string, v ArrayMarshaler) error + func (m *MapObjectEncoder) AddBinary(k string, v []byte) + func (m *MapObjectEncoder) AddBool(k string, v bool) + func (m *MapObjectEncoder) AddByteString(k string, v []byte) + func (m *MapObjectEncoder) AddComplex128(k string, v complex128) + func (m *MapObjectEncoder) AddComplex64(k string, v complex64) + func (m *MapObjectEncoder) AddFloat32(k string, v float32) + func (m *MapObjectEncoder) AddFloat64(k string, v float64) + func (m *MapObjectEncoder) AddInt(k string, v int) + func (m *MapObjectEncoder) AddInt16(k string, v int16) + func (m *MapObjectEncoder) AddInt32(k string, v int32) + func (m *MapObjectEncoder) AddInt64(k string, v int64) + func (m *MapObjectEncoder) AddInt8(k string, v int8) + func (m *MapObjectEncoder) AddObject(k string, v ObjectMarshaler) error + func (m *MapObjectEncoder) AddReflected(k string, v interface{}) error + func (m *MapObjectEncoder) AddString(k string, v string) + func (m *MapObjectEncoder) AddUint(k string, v uint) + func (m *MapObjectEncoder) AddUint16(k string, v uint16) + func (m *MapObjectEncoder) AddUint32(k string, v uint32) + func (m *MapObjectEncoder) AddUint64(k string, v uint64) + func (m *MapObjectEncoder) AddUint8(k string, v uint8) + func (m *MapObjectEncoder) AddUintptr(k string, v uintptr) + func (m *MapObjectEncoder) OpenNamespace(k string) + func (m MapObjectEncoder) AddDuration(k string, v time.Duration) + func (m MapObjectEncoder) AddTime(k string, v int64) + type ObjectEncoder interface + AddArray func(key string, marshaler ArrayMarshaler) error + AddBinary func(key string, value []byte) + AddBool func(key string, value bool) + AddByteString func(key string, value []byte) + AddComplex128 func(key string, value complex128) + AddComplex64 func(key string, value complex64) + AddDuration func(key string, value time.Duration) + AddFloat32 func(key string, value float32) + AddFloat64 func(key string, value float64) + AddInt func(key string, value int) + AddInt16 func(key string, value int16) + AddInt32 func(key string, value int32) + AddInt64 func(key string, value int64) + AddInt8 func(key string, value int8) + AddObject func(key string, marshaler ObjectMarshaler) error + AddReflected func(key string, value interface{}) error + AddString func(key, value string) + AddTime func(key string, value int64) + AddUint func(key string, value uint) + AddUint16 func(key string, value uint16) + AddUint32 func(key string, value uint32) + AddUint64 func(key string, value uint64) + AddUint8 func(key string, value uint8) + AddUintptr func(key string, value uintptr) + OpenNamespace func(key string) + type ObjectMarshaler interface + MarshalLogObject func(ObjectEncoder) error + type ObjectMarshalerFunc func(ObjectEncoder) error + func (f ObjectMarshalerFunc) MarshalLogObject(enc ObjectEncoder) error + type PrimitiveArrayEncoder interface + AppendBool func(bool) + AppendByteString func([]byte) + AppendComplex128 func(complex128) + AppendComplex64 func(complex64) + AppendFloat32 func(float32) + AppendFloat64 func(float64) + AppendInt func(int) + AppendInt16 func(int16) + AppendInt32 func(int32) + AppendInt64 func(int64) + AppendInt8 func(int8) + AppendString func(string) + AppendUint func(uint) + AppendUint16 func(uint16) + AppendUint32 func(uint32) + AppendUint64 func(uint64) + AppendUint8 func(uint8) + AppendUintptr func(uintptr) + type TimeEncoder func(int64, PrimitiveArrayEncoder) + func (e *TimeEncoder) UnmarshalText(text []byte) error + type WriteSyncer interface + Sync func() error + func AddSync(w io.Writer) WriteSyncer + func Lock(ws WriteSyncer) WriteSyncer + func NewMultiWriteSyncer(ws ...WriteSyncer) WriteSyncer