Documentation
¶
Index ¶
- type ContextMetaLoggerType
- type Field
- func Any(name string, val any) Field
- func Bool(key string, val bool) Field
- func Duration(key string, val time.Duration) Field
- func Error(err error) Field
- func Float64(key string, val float64) Field
- func Float64p(key string, val *float64) Field
- func Int(key string, val int) Field
- func Int64(key string, val int64) Field
- func MainMessage() Field
- func Stack(name string) Field
- func String(key string, val string) Field
- func Stringp(key string, val *string) Field
- func Strings(key string, val []string) Field
- func Time(key string, val time.Time) Field
- type FieldType
- type MetaLogger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContextMetaLoggerType ¶
type ContextMetaLoggerType string
const (
ContextMetaLogger ContextMetaLoggerType = "ContextMetaLogger"
)
type Field ¶
type Field struct {
Key string
Type FieldType
Integer int64
Float64 float64
String string
Interface any
}
func MainMessage ¶
func MainMessage() Field
type MetaLogger ¶
type MetaLogger interface {
Debug(msg string, fields ...Field)
Info(msg string, fields ...Field)
Warn(msg string, fields ...Field)
Error(msg string, fields ...Field)
DPanic(msg string, fields ...Field)
Panic(msg string, fields ...Field)
Fatal(msg string, fields ...Field)
Infof(template string, args ...interface{})
Add(fields ...Field)
With(fields ...Field) MetaLogger
Sync() error
Flush()
Verbose() MetaLogger
SetContextLogger(ctx context.Context) context.Context
SlogHandler() slog.Handler
}
MetaLogger implements logging functionality
func GetContextLogger ¶
func GetContextLogger(ctx context.Context) MetaLogger
GetContextLogger returns a meta logger extracted from context.
Click to show internal directories.
Click to hide internal directories.