Documentation
¶
Overview ¶
Package interfaces defines the Entry interface for log entries.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DynamicFormatter ¶
func (*DynamicFormatter[T]) Format ¶
func (f *DynamicFormatter[T]) Format(e T) ([]byte, error)
type HookG ¶
HookG é executado antes da formatação/escrita. Pode enriquecer o record, coletar métricas, enviar para outro sistema, etc.
type HooksG ¶
HooksG é uma coleção de hooks.
type Logger ¶
type Logger interface {
SetFormatter(f formatter.Formatter)
SetOutput(w io.Writer)
SetMinLevel(min kbx.Level)
Enabled(level kbx.Level) bool
GetMinLevel() kbx.Level
GetLevel() kbx.Level
SetRotate(rotate bool)
SetRotateMaxSize(size int64)
SetRotateMaxBack(back int64)
SetRotateMaxAge(age int64)
SetCompress(compress bool)
SetBufferSize(size int)
SetFlushInterval(interval time.Duration)
SetHooks(hooks []Hook)
SetLHooks(hooks LHook[any])
SetMetadata(metadata map[string]any)
SetConfig(config *kbx.LogzConfig)
Log(lvl kbx.Level, args ...any) error
LogAny(level kbx.Level, args ...any) error
AddHook(h Hook)
}
type LoggerFunc ¶
type LoggerFuncG ¶
type LoggerZ ¶
type LoggerZ[T Hook | *kbx.Entry] interface { SetFormatter(f formatter.Formatter) SetOutput(w io.Writer) SetMinLevel(min kbx.Level) Enabled(level kbx.Level) bool SetConfig(config *kbx.LogzConfig) Log(level kbx.Level, rec T) error AddHook(h HookG[T]) SetDebugMode(debug bool) Debug(msg ...any) Notice(msg ...any) Info(msg ...any) Success(msg ...any) Warn(msg ...any) Error(msg ...any) error Fatal(msg ...any) Trace(msg ...any) Critical(msg ...any) Answer(msg ...any) Alert(msg ...any) Bug(msg ...any) Panic(msg ...any) Println(msg ...any) Printf(format string, args ...any) Debugf(format string, args ...any) Infof(format string, args ...any) Noticef(format string, args ...any) Successf(format string, args ...any) Warnf(format string, args ...any) Errorf(format string, args ...any) error Fatalf(format string, args ...any) Tracef(format string, args ...any) Criticalf(format string, args ...any) Answerf(format string, args ...any) Alertf(format string, args ...any) Bugf(format string, args ...any) Panicf(format string, args ...any) }
Click to show internal directories.
Click to hide internal directories.