Documentation
¶
Overview ¶
wrappers for slog methods see: https://pkg.go.dev/log/slog#example-package-Wrapping
Index ¶
- func Audit(ctx context.Context, msg string, args ...any)
- func BufferDefaultLogs()
- func Debug(ctx context.Context, msg string, args ...any)
- func Error(ctx context.Context, msg string, args ...any)
- func FlushBufferedLogs(ctx context.Context, handle func(context.Context, slog.Record) error) []error
- func FlushBufferedLogsToStderr()
- func Info(ctx context.Context, msg string, args ...any)
- func Init(conf *Config, contextGetters common.ContextGetters) (closer common.Closer, err error)
- func Module(module common.Module)
- func NewBufferedLogger(level slog.Leveler) slog.Handler
- func NewJsonLogger(o *Options) slog.Handler
- func SetGlobalLoggingLevel(level slog.Leveler)
- func Trace(ctx context.Context, msg string, args ...any)
- func Warn(ctx context.Context, msg string, args ...any)
- type Config
- type Driver
- type Level
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BufferDefaultLogs ¶
func BufferDefaultLogs()
func FlushBufferedLogs ¶
func FlushBufferedLogsToStderr ¶
func FlushBufferedLogsToStderr()
func NewJsonLogger ¶
func SetGlobalLoggingLevel ¶
Types ¶
type Config ¶
type Config struct {
Level Level `json:"level" env:"UNIOND_LOGGING_LEVEL"`
Driver Driver `json:"driver" env:"UNIOND_LOGGING_DRIVER" validate:"oneof=stderr stdout file"`
}
func DefaultConfig ¶
func DefaultConfig() Config
Click to show internal directories.
Click to hide internal directories.