Versions in this module Expand all Collapse all v0 v0.1.0 Jun 14, 2021 Changes in this version + const DefaultLineEnding + const OmitKey + func CapitalColorLevelEncoder(l Level, enc PrimitiveArrayEncoder) + func CapitalLevelEncoder(l Level, enc PrimitiveArrayEncoder) + func EpochMillisTimeEncoder(t time.Time, enc PrimitiveArrayEncoder) + func EpochNanosTimeEncoder(t time.Time, enc PrimitiveArrayEncoder) + func EpochTimeEncoder(t time.Time, enc PrimitiveArrayEncoder) + func FullCallerEncoder(caller EntryCaller, enc PrimitiveArrayEncoder) + func FullNameEncoder(loggerName string, enc PrimitiveArrayEncoder) + func ISO8601TimeEncoder(t time.Time, enc PrimitiveArrayEncoder) + func LowercaseColorLevelEncoder(l Level, enc PrimitiveArrayEncoder) + func LowercaseLevelEncoder(l Level, enc PrimitiveArrayEncoder) + func MillisDurationEncoder(d time.Duration, enc PrimitiveArrayEncoder) + func NanosDurationEncoder(d time.Duration, enc PrimitiveArrayEncoder) + func RFC3339NanoTimeEncoder(t time.Time, enc PrimitiveArrayEncoder) + func RFC3339TimeEncoder(t time.Time, enc PrimitiveArrayEncoder) + func SecondsDurationEncoder(d time.Duration, enc PrimitiveArrayEncoder) + func ShortCallerEncoder(caller EntryCaller, 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(time.Time) + type ArrayMarshaler interface + MarshalLogArray func(ArrayEncoder) error + type ArrayMarshalerFunc func(ArrayEncoder) error + func (f ArrayMarshalerFunc) MarshalLogArray(enc ArrayEncoder) error + type CallerEncoder func(EntryCaller, PrimitiveArrayEncoder) + func (e *CallerEncoder) UnmarshalText(text []byte) error + type CheckWriteAction uint8 + const WriteThenFatal + const WriteThenGoexit + const WriteThenNoop + const WriteThenPanic + type CheckedEntry struct + ErrorOutput WriteSyncer + 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 + func NewIncreaseLevelCore(core Core, level LevelEnabler) (Core, error) + func NewNopCore() Core + func NewSampler(core Core, tick time.Duration, first, thereafter int) Core + func NewSamplerWithOptions(core Core, tick time.Duration, first, thereafter int, opts ...SamplerOption) Core + func NewTee(cores ...Core) Core + func RegisterHooks(core Core, hooks ...func(Entry) error) 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 NewConsoleEncoder(cfg EncoderConfig) Encoder + func NewJSONEncoder(cfg EncoderConfig) Encoder + type EncoderConfig struct + CallerKey string + ConsoleSeparator string + EncodeCaller CallerEncoder + EncodeDuration DurationEncoder + EncodeLevel LevelEncoder + EncodeName NameEncoder + EncodeTime TimeEncoder + FunctionKey string + LevelKey string + LineEnding string + MessageKey string + NameKey string + StacktraceKey string + TimeKey string + type Entry struct + Caller EntryCaller + Level Level + LoggerName string + Message string + Stack string + Time time.Time + type EntryCaller struct + Defined bool + File string + Function string + Line int + PC uintptr + func NewEntryCaller(pc uintptr, file string, line int, ok bool) EntryCaller + func (ec EntryCaller) FullPath() string + func (ec EntryCaller) String() string + func (ec EntryCaller) TrimmedPath() string + 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 InlineMarshalerType + const Int16Type + const Int32Type + const Int64Type + const Int8Type + const NamespaceType + const ObjectMarshalerType + const ReflectType + const SkipType + const StringType + const StringerType + const TimeFullType + 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 time.Time) + type NameEncoder func(string, PrimitiveArrayEncoder) + func (e *NameEncoder) UnmarshalText(text []byte) error + 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 time.Time) + 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 SamplerOption interface + func SamplerHook(hook func(entry Entry, dec SamplingDecision)) SamplerOption + type SamplingDecision uint32 + const LogDropped + const LogSampled + type TimeEncoder func(time.Time, PrimitiveArrayEncoder) + func TimeEncoderOfLayout(layout string) TimeEncoder + func (e *TimeEncoder) UnmarshalJSON(data []byte) error + func (e *TimeEncoder) UnmarshalText(text []byte) error + func (e *TimeEncoder) UnmarshalYAML(unmarshal func(interface{}) error) error + type WriteSyncer interface + Sync func() error + func AddSync(w io.Writer) WriteSyncer + func Lock(ws WriteSyncer) WriteSyncer + func NewMultiWriteSyncer(ws ...WriteSyncer) WriteSyncer