logger

package
v1.6.23 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: Apache-2.0 Imports: 6 Imported by: 7

Documentation

Index

Constants

View Source
const (
	LevelTrace = slog.Level(-8)
	LevelDebug = slog.LevelDebug
	LevelInfo  = slog.LevelInfo
	LevelWarn  = slog.LevelWarn
	LevelError = slog.LevelError
)

Variables

This section is empty.

Functions

func NewLevelHandler added in v1.6.21

func NewLevelHandler(handler slog.Handler, level slog.Leveler) slog.Handler

Types

type LevelHandler added in v1.6.21

type LevelHandler struct {
	// contains filtered or unexported fields
}

func (*LevelHandler) Enabled added in v1.6.21

func (h *LevelHandler) Enabled(ctx context.Context, level slog.Level) bool

func (*LevelHandler) Handle added in v1.6.21

func (h *LevelHandler) Handle(ctx context.Context, record slog.Record) error

func (*LevelHandler) WithAttrs added in v1.6.21

func (h *LevelHandler) WithAttrs(attrs []slog.Attr) slog.Handler

func (*LevelHandler) WithGroup added in v1.6.21

func (h *LevelHandler) WithGroup(name string) slog.Handler

type MultiHandler added in v1.6.21

type MultiHandler struct {
	// contains filtered or unexported fields
}

func NewMultiHandler added in v1.6.21

func NewMultiHandler(handlers ...slog.Handler) *MultiHandler

func (*MultiHandler) Enabled added in v1.6.21

func (h *MultiHandler) Enabled(ctx context.Context, level slog.Level) bool

func (*MultiHandler) Handle added in v1.6.21

func (h *MultiHandler) Handle(ctx context.Context, record slog.Record) error

func (*MultiHandler) WithAttrs added in v1.6.21

func (h *MultiHandler) WithAttrs(attrs []slog.Attr) slog.Handler

func (*MultiHandler) WithGroup added in v1.6.21

func (h *MultiHandler) WithGroup(name string) slog.Handler

type TermHandler

type TermHandler struct {
	io.Writer
	// contains filtered or unexported fields
}

func NewTermHandler added in v1.6.14

func NewTermHandler(w io.Writer, level *slog.LevelVar) *TermHandler

func (*TermHandler) Enabled

func (h *TermHandler) Enabled(ctx context.Context, level slog.Level) bool

func (*TermHandler) Handle

func (h *TermHandler) Handle(ctx context.Context, r slog.Record) error

func (*TermHandler) WithAttrs

func (h *TermHandler) WithAttrs(attrs []slog.Attr) slog.Handler

func (*TermHandler) WithGroup

func (h *TermHandler) WithGroup(name string) slog.Handler

Jump to

Keyboard shortcuts

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