logging

package
v0.4.25 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HookHandler

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

func NewHookHandler

func NewHookHandler(handler slog.Handler, opts *HookHandlerOptions) *HookHandler

func (*HookHandler) Enabled

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

func (*HookHandler) Handle

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

func (*HookHandler) SetLevel

func (h *HookHandler) SetLevel(level slog.Level)

func (*HookHandler) WithAttrs

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

func (*HookHandler) WithGroup

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

type HookHandlerOptions

type HookHandlerOptions struct {
	Level     slog.Leveler
	WriteFunc func(ctx context.Context, record Record) error
}

type NamedHandler added in v0.4.25

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

func NewNamedHandler added in v0.4.25

func NewNamedHandler(handler slog.Handler, namespace string) *NamedHandler

func (*NamedHandler) Enabled added in v0.4.25

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

func (*NamedHandler) Handle added in v0.4.25

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

func (*NamedHandler) WithAttrs added in v0.4.25

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

func (*NamedHandler) WithGroup added in v0.4.25

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

type Record

type Record struct {
	slog.Record
}

func (Record) Data

func (r Record) Data() types.JSONMap[any]

Jump to

Keyboard shortcuts

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