slogutil

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: LGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SlogMessageOnlyHandler

type SlogMessageOnlyHandler struct {
	Level slog.Level
}

SlogMessageOnlyHandler is a trivial slog handler that prints only messages. All attributes and groups are ignored. It's useful in example tests where it produces output that's normalized so we match against it (normally, all log lines include timestamps so it's not possible to have reproducible output).

func (*SlogMessageOnlyHandler) Enabled

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

func (*SlogMessageOnlyHandler) Handle

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

func (*SlogMessageOnlyHandler) WithAttrs

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

func (*SlogMessageOnlyHandler) WithGroup

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

Jump to

Keyboard shortcuts

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