Documentation
¶
Overview ¶
package zaplipgloss implements a zap encoder that formats its body using charmbracelet lipgloss.
Index ¶
- type LipglossEncoder
- func (l *LipglossEncoder) AddArray(key string, marshaler zapcore.ArrayMarshaler) error
- func (l *LipglossEncoder) AddBinary(key string, value []byte)
- func (l *LipglossEncoder) AddBool(key string, value bool)
- func (l *LipglossEncoder) AddByteString(key string, value []byte)
- func (l *LipglossEncoder) AddComplex64(key string, value complex64)
- func (l *LipglossEncoder) AddComplex128(key string, value complex128)
- func (l *LipglossEncoder) AddDuration(key string, value time.Duration)
- func (l *LipglossEncoder) AddFloat32(key string, value float32)
- func (l *LipglossEncoder) AddFloat64(key string, value float64)
- func (l *LipglossEncoder) AddInt(k string, v int)
- func (l *LipglossEncoder) AddInt8(k string, v int8)
- func (l *LipglossEncoder) AddInt16(k string, v int16)
- func (l *LipglossEncoder) AddInt32(k string, v int32)
- func (l *LipglossEncoder) AddInt64(key string, value int64)
- func (l *LipglossEncoder) AddObject(key string, marshaler zapcore.ObjectMarshaler) error
- func (l *LipglossEncoder) AddReflected(key string, value interface{}) error
- func (l *LipglossEncoder) AddString(key string, value string)
- func (l *LipglossEncoder) AddTime(key string, value time.Time)
- func (l *LipglossEncoder) AddUint(k string, v uint)
- func (l *LipglossEncoder) AddUint8(k string, v uint8)
- func (l *LipglossEncoder) AddUint16(k string, v uint16)
- func (l *LipglossEncoder) AddUint32(k string, v uint32)
- func (l *LipglossEncoder) AddUint64(key string, value uint64)
- func (l *LipglossEncoder) AddUintptr(k string, v uintptr)
- func (l *LipglossEncoder) AppendArray(arr zapcore.ArrayMarshaler) error
- func (l *LipglossEncoder) AppendBool(val bool)
- func (l *LipglossEncoder) AppendByteString(val []byte)
- func (l *LipglossEncoder) AppendComplex64(v complex64)
- func (l *LipglossEncoder) AppendComplex128(v complex128)
- func (l *LipglossEncoder) AppendDuration(val time.Duration)
- func (l *LipglossEncoder) AppendFloat32(v float32)
- func (l *LipglossEncoder) AppendFloat64(v float64)
- func (l *LipglossEncoder) AppendInt(v int)
- func (l *LipglossEncoder) AppendInt8(v int8)
- func (l *LipglossEncoder) AppendInt16(v int16)
- func (l *LipglossEncoder) AppendInt32(v int32)
- func (l *LipglossEncoder) AppendInt64(val int64)
- func (l *LipglossEncoder) AppendObject(val zapcore.ObjectMarshaler) (_ error)
- func (l *LipglossEncoder) AppendReflected(value any) error
- func (l *LipglossEncoder) AppendString(val string)
- func (l *LipglossEncoder) AppendTime(val time.Time)
- func (l *LipglossEncoder) AppendUint(v uint)
- func (l *LipglossEncoder) AppendUint8(v uint8)
- func (l *LipglossEncoder) AppendUint16(v uint16)
- func (l *LipglossEncoder) AppendUint32(v uint32)
- func (l *LipglossEncoder) AppendUint64(val uint64)
- func (l *LipglossEncoder) AppendUintptr(v uintptr)
- func (l *LipglossEncoder) Clone() zapcore.Encoder
- func (l *LipglossEncoder) EncodeEntry(entry zapcore.Entry, fields []zapcore.Field) (*buffer.Buffer, error)
- func (l *LipglossEncoder) OpenNamespace(key string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LipglossEncoder ¶
type LipglossEncoder struct {
// contains filtered or unexported fields
}
func NewLipglossEncoder ¶
func NewLipglossEncoder(cfg zapcore.EncoderConfig) (*LipglossEncoder, error)
NewLipglossEncoder creates a new Lipgloss Zap Encoder.
func (*LipglossEncoder) AddArray ¶
func (l *LipglossEncoder) AddArray(key string, marshaler zapcore.ArrayMarshaler) error
Logging-specific marshalers.
func (*LipglossEncoder) AddBinary ¶
func (l *LipglossEncoder) AddBinary(key string, value []byte)
Built-in types.
func (*LipglossEncoder) AddBool ¶
func (l *LipglossEncoder) AddBool(key string, value bool)
func (*LipglossEncoder) AddByteString ¶
func (l *LipglossEncoder) AddByteString(key string, value []byte)
func (*LipglossEncoder) AddComplex64 ¶
func (l *LipglossEncoder) AddComplex64(key string, value complex64)
func (*LipglossEncoder) AddComplex128 ¶
func (l *LipglossEncoder) AddComplex128(key string, value complex128)
func (*LipglossEncoder) AddDuration ¶
func (l *LipglossEncoder) AddDuration(key string, value time.Duration)
func (*LipglossEncoder) AddFloat32 ¶
func (l *LipglossEncoder) AddFloat32(key string, value float32)
func (*LipglossEncoder) AddFloat64 ¶
func (l *LipglossEncoder) AddFloat64(key string, value float64)
func (*LipglossEncoder) AddInt ¶
func (l *LipglossEncoder) AddInt(k string, v int)
func (*LipglossEncoder) AddInt8 ¶
func (l *LipglossEncoder) AddInt8(k string, v int8)
func (*LipglossEncoder) AddInt16 ¶
func (l *LipglossEncoder) AddInt16(k string, v int16)
func (*LipglossEncoder) AddInt32 ¶
func (l *LipglossEncoder) AddInt32(k string, v int32)
func (*LipglossEncoder) AddInt64 ¶
func (l *LipglossEncoder) AddInt64(key string, value int64)
func (*LipglossEncoder) AddObject ¶
func (l *LipglossEncoder) AddObject(key string, marshaler zapcore.ObjectMarshaler) error
func (*LipglossEncoder) AddReflected ¶
func (l *LipglossEncoder) AddReflected(key string, value interface{}) error
AddReflected uses reflection to serialize arbitrary objects, so it can be slow and allocation-heavy.
func (*LipglossEncoder) AddString ¶
func (l *LipglossEncoder) AddString(key string, value string)
func (*LipglossEncoder) AddUint ¶
func (l *LipglossEncoder) AddUint(k string, v uint)
func (*LipglossEncoder) AddUint8 ¶
func (l *LipglossEncoder) AddUint8(k string, v uint8)
func (*LipglossEncoder) AddUint16 ¶
func (l *LipglossEncoder) AddUint16(k string, v uint16)
func (*LipglossEncoder) AddUint32 ¶
func (l *LipglossEncoder) AddUint32(k string, v uint32)
func (*LipglossEncoder) AddUint64 ¶
func (l *LipglossEncoder) AddUint64(key string, value uint64)
func (*LipglossEncoder) AddUintptr ¶
func (l *LipglossEncoder) AddUintptr(k string, v uintptr)
func (*LipglossEncoder) AppendArray ¶
func (l *LipglossEncoder) AppendArray(arr zapcore.ArrayMarshaler) error
func (*LipglossEncoder) AppendByteString ¶
func (l *LipglossEncoder) AppendByteString(val []byte)
func (*LipglossEncoder) AppendComplex64 ¶
func (l *LipglossEncoder) AppendComplex64(v complex64)
func (*LipglossEncoder) AppendComplex128 ¶
func (l *LipglossEncoder) AppendComplex128(v complex128)
func (*LipglossEncoder) AppendDuration ¶
func (l *LipglossEncoder) AppendDuration(val time.Duration)
Time-related types.
func (*LipglossEncoder) AppendFloat32 ¶
func (l *LipglossEncoder) AppendFloat32(v float32)
func (*LipglossEncoder) AppendFloat64 ¶
func (l *LipglossEncoder) AppendFloat64(v float64)
func (*LipglossEncoder) AppendInt ¶
func (l *LipglossEncoder) AppendInt(v int)
func (*LipglossEncoder) AppendInt8 ¶
func (l *LipglossEncoder) AppendInt8(v int8)
func (*LipglossEncoder) AppendInt16 ¶
func (l *LipglossEncoder) AppendInt16(v int16)
func (*LipglossEncoder) AppendInt32 ¶
func (l *LipglossEncoder) AppendInt32(v int32)
func (*LipglossEncoder) AppendInt64 ¶
func (l *LipglossEncoder) AppendInt64(val int64)
func (*LipglossEncoder) AppendObject ¶
func (l *LipglossEncoder) AppendObject(val zapcore.ObjectMarshaler) (_ error)
func (*LipglossEncoder) AppendReflected ¶
func (l *LipglossEncoder) AppendReflected(value any) error
AppendReflected uses reflection to serialize arbitrary objects, so it's slow and allocation-heavy.
func (*LipglossEncoder) AppendString ¶
func (l *LipglossEncoder) AppendString(val string)
func (*LipglossEncoder) AppendTime ¶
func (l *LipglossEncoder) AppendTime(val time.Time)
func (*LipglossEncoder) AppendUint ¶
func (l *LipglossEncoder) AppendUint(v uint)
func (*LipglossEncoder) AppendUint8 ¶
func (l *LipglossEncoder) AppendUint8(v uint8)
func (*LipglossEncoder) AppendUint16 ¶
func (l *LipglossEncoder) AppendUint16(v uint16)
func (*LipglossEncoder) AppendUint32 ¶
func (l *LipglossEncoder) AppendUint32(v uint32)
func (*LipglossEncoder) AppendUint64 ¶
func (l *LipglossEncoder) AppendUint64(val uint64)
func (*LipglossEncoder) AppendUintptr ¶
func (l *LipglossEncoder) AppendUintptr(v uintptr)
func (*LipglossEncoder) Clone ¶
func (l *LipglossEncoder) Clone() zapcore.Encoder
Clone copies the encoder, ensuring that adding fields to the copy doesn't affect the original.
func (*LipglossEncoder) EncodeEntry ¶
func (l *LipglossEncoder) EncodeEntry(entry zapcore.Entry, fields []zapcore.Field) (*buffer.Buffer, error)
EncodeEntry encodes an entry and fields, along with any accumulated context, into a byte buffer and returns it. Any fields that are empty, including fields on the `Entry` type, should be omitted.
func (*LipglossEncoder) OpenNamespace ¶
func (l *LipglossEncoder) OpenNamespace(key string)
OpenNamespace opens an isolated namespace where all subsequent fields will be added. Applications can use namespaces to prevent key collisions when injecting loggers into sub-components or third-party libraries.