log

package
v1.11.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 13, 2026 License: MIT Imports: 17 Imported by: 15

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttrsFromMap

func AttrsFromMap(m map[string]any) []any

Types

type ContextExtractor

type ContextExtractor interface {
	Handle(context.Context, *slog.Record) error
}

type ContextExtractorFunction

type ContextExtractorFunction func(context.Context, *slog.Record) error

func (ContextExtractorFunction) Handle

func (cef ContextExtractorFunction) Handle(ctx context.Context, record *slog.Record) error

type ContextHandler

type ContextHandler struct {
	Next       slog.Handler
	Extractors []ContextExtractor
}

func (*ContextHandler) Enabled

func (contextHandler *ContextHandler) Enabled(ctx context.Context, level slog.Level) bool

func (*ContextHandler) Handle

func (contextHandler *ContextHandler) Handle(ctx context.Context, record slog.Record) error

func (*ContextHandler) WithAttrs

func (contextHandler *ContextHandler) WithAttrs(attrs []slog.Attr) slog.Handler

func (*ContextHandler) WithGroup

func (contextHandler *ContextHandler) WithGroup(name string) slog.Handler

type ErrorContextExtractor

type ErrorContextExtractor struct {
	SkipCause         bool
	SkipInput         bool
	SkipStackTrace    bool
	SkipOutput        bool
	ContextExtractors []ContextExtractor
}

func (*ErrorContextExtractor) Handle

func (extractor *ErrorContextExtractor) Handle(ctx context.Context, record *slog.Record) error

func (*ErrorContextExtractor) MakeErrorAttrs

func (extractor *ErrorContextExtractor) MakeErrorAttrs(err error) []any

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL