Documentation
¶
Index ¶
- Constants
- func Close() error
- func DebugContext(ctx context.Context, msg string, args ...any)
- func DefaultLevel() slog.Level
- func DefaultLeveler() slog.Leveler
- func DefaultOutput() io.Writer
- func ErrorContext(ctx context.Context, msg string, args ...any)
- func FatalContext(ctx context.Context, msg string, args ...any)
- func GetContextArgs(ctx context.Context, args ...string) []any
- func GetEventBaseId(ctx context.Context) string
- func GetEventId(ctx context.Context) string
- func GetEventLastId(ctx context.Context) string
- func GetLevel(ctx context.Context) slog.Level
- func GetName(ctx context.Context) string
- func GetValue(ctx context.Context, key string) any
- func GetValues(ctx context.Context) map[string]any
- func GetValuesAny(ctx context.Context) any
- func InfoContext(ctx context.Context, msg string, args ...any)
- func MakeEventId(event string) string
- func ParseFormat(args ...string) (int, error)
- func ParseLevel(args ...string) (int, error)
- func ParseOutput(args ...string) (int, error)
- func RegisterContextAnyArg[T any](arg string, getter func(context.Context) T)
- func RegisterContextNonZeroArg[T comparable](arg string, getter func(context.Context) T)
- func SetDefault(logger Logger)
- func SetDefaultLevel(level slog.Level)
- func SetDefaultOutput(output io.Writer)
- func SetEvent(ctx context.Context, event string) context.Context
- func SetEventId(ctx context.Context, eventId string) context.Context
- func SetName(ctx context.Context, name string) context.Context
- func UnregisterContextArg(arg string)
- func WarnContext(ctx context.Context, msg string, args ...any)
- func WithEvent(ctx context.Context, event string) context.Context
- func WithEventId(ctx context.Context, eventId string) context.Context
- func WithLevel(ctx context.Context, level slog.Level) context.Context
- func WithLogger(ctx context.Context, logger Logger) context.Context
- func WithName(ctx context.Context, name string) context.Context
- func WithValue(ctx context.Context, key string, value any) context.Context
- func WrapLevelHandler(handler slog.Handler) slog.Handler
- type Logger
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func DefaultLevel ¶
func DefaultLeveler ¶
func DefaultOutput ¶
func GetEventBaseId ¶
func GetEventId ¶
func GetEventLastId ¶
func GetValuesAny ¶
func MakeEventId ¶
func ParseFormat ¶
func ParseLevel ¶
func ParseOutput ¶
func RegisterContextAnyArg ¶
func RegisterContextNonZeroArg ¶
func RegisterContextNonZeroArg[T comparable](arg string, getter func(context.Context) T)
func SetDefault ¶
func SetDefault(logger Logger)
func SetDefaultLevel ¶
func SetDefaultOutput ¶
func UnregisterContextArg ¶
func UnregisterContextArg(arg string)
Types ¶
type Logger ¶
type Logger interface { DebugContext(ctx context.Context, msg string, args ...any) InfoContext(ctx context.Context, msg string, args ...any) WarnContext(ctx context.Context, msg string, args ...any) ErrorContext(ctx context.Context, msg string, args ...any) }
func NewJsonLogger ¶
func NewTextLogger ¶
func WrapLogger ¶
Click to show internal directories.
Click to hide internal directories.