Documentation
¶
Index ¶
- type AsyncHandler
- type AsyncHandlerOptions
- type Attribute
- func Any(v any) Attribute
- func Bool(key string, value bool) Attribute
- func Duration(key string, value time.Duration) Attribute
- func Err(err error) Attribute
- func Float32(key string, value float32) Attribute
- func Float64(key string, value float64) Attribute
- func Int(key string, value int) Attribute
- func Int32(key string, value int32) Attribute
- func Int64(key string, value int64) Attribute
- func String(key string, value any) Attribute
- func Time(key string, value time.Time) Attribute
- func Uint(key string, value uint) Attribute
- func Uint32(key string, value uint32) Attribute
- func Uint64(key string, value uint64) Attribute
- type Colorful
- type ColorfulPaint
- type ColorfulTextRecordEncoder
- type Group
- type Handler
- type JsonRecordEncoder
- type Level
- type Logger
- type Moss
- func (moss *Moss) Attr(attrs ...Attribute) Logger
- func (moss *Moss) CallerSkipShift(shift int) Logger
- func (moss *Moss) Close() error
- func (moss *Moss) Debug(ctx context.Context, msg string, args ...any)
- func (moss *Moss) DebugEnabled() bool
- func (moss *Moss) Error(ctx context.Context, msg string, args ...any)
- func (moss *Moss) ErrorEnabled() bool
- func (moss *Moss) Group(name string) Logger
- func (moss *Moss) Info(ctx context.Context, msg string, args ...any)
- func (moss *Moss) InfoEnabled() bool
- func (moss *Moss) Warn(ctx context.Context, msg string, args ...any)
- func (moss *Moss) WarnEnabled() bool
- type Option
- type Options
- type Record
- type RecordEncoder
- type Source
- type StandardOutHandler
- type TextRecordEncoder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AsyncHandler ¶
type AsyncHandler struct {
// contains filtered or unexported fields
}
func (*AsyncHandler) Close ¶
func (handler *AsyncHandler) Close() error
type AsyncHandlerOptions ¶
type ColorfulPaint ¶
type ColorfulPaint struct {
// contains filtered or unexported fields
}
type ColorfulTextRecordEncoder ¶
type ColorfulTextRecordEncoder struct {
// contains filtered or unexported fields
}
func (*ColorfulTextRecordEncoder) Encode ¶
func (encoder *ColorfulTextRecordEncoder) Encode(r *Record) []byte
Encode
[LEVEL] [TIME] [FUNC] [FILE:LINE] [- ] key=value ... // group 取出 最长的 ,然后 padding [GROUP] key=value ... MESSAGE >>> ERROR {ERR} <<<
type Group ¶
func (*Group) MergeAttributes ¶
type Handler ¶
func NewAsyncHandler ¶
func NewAsyncHandler(proxy Handler, options AsyncHandlerOptions) Handler
func NewStandardOutColorfulHandler ¶
func NewStandardOutColorfulHandler() Handler
func NewStandardOutHandler ¶
func NewStandardOutHandler() Handler
func NewStandardOutJsonHandler ¶
func NewStandardOutJsonHandler() Handler
type JsonRecordEncoder ¶
type JsonRecordEncoder struct {
// contains filtered or unexported fields
}
func (*JsonRecordEncoder) Encode ¶
func (encoder *JsonRecordEncoder) Encode(r *Record) []byte
type Logger ¶
type Logger interface {
Group(name string) Logger
Attr(attrs ...Attribute) Logger
CallerSkipShift(shift int) Logger
DebugEnabled() bool
Debug(ctx context.Context, msg string, args ...any)
InfoEnabled() bool
Info(ctx context.Context, msg string, args ...any)
WarnEnabled() bool
Warn(ctx context.Context, msg string, args ...any)
ErrorEnabled() bool
Error(ctx context.Context, msg string, args ...any)
Close() error
}
type Moss ¶
type Moss struct {
// contains filtered or unexported fields
}
func (*Moss) CallerSkipShift ¶
func (*Moss) DebugEnabled ¶
func (*Moss) ErrorEnabled ¶
func (*Moss) InfoEnabled ¶
func (*Moss) WarnEnabled ¶
type RecordEncoder ¶
func NewColorfulTextRecordEncoder ¶
func NewColorfulTextRecordEncoder() RecordEncoder
func NewJsonRecordEncoder ¶
func NewJsonRecordEncoder() RecordEncoder
func NewTextRecordEncoder ¶
func NewTextRecordEncoder() RecordEncoder
type Source ¶
func (*Source) RelativePath ¶
type StandardOutHandler ¶
type StandardOutHandler struct {
// contains filtered or unexported fields
}
func (*StandardOutHandler) Close ¶
func (handler *StandardOutHandler) Close() error
type TextRecordEncoder ¶
type TextRecordEncoder struct {
// contains filtered or unexported fields
}
func (*TextRecordEncoder) Encode ¶
func (encoder *TextRecordEncoder) Encode(r *Record) []byte
Encode
[LEVEL] [TIME] [FILE:LINE] MESSAGE [GROUP: KEY=VAL...] [GROUP: KEY=VAL...]
Click to show internal directories.
Click to hide internal directories.