Documentation
¶
Index ¶
- type SliceInt64
- type SliceString
- type SlogMessageOnlyHandler
- func (h *SlogMessageOnlyHandler) Enabled(ctx context.Context, level slog.Level) bool
- func (h *SlogMessageOnlyHandler) Handle(ctx context.Context, record slog.Record) error
- func (h *SlogMessageOnlyHandler) WithAttrs(attrs []slog.Attr) slog.Handler
- func (h *SlogMessageOnlyHandler) WithGroup(name string) slog.Handler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SliceInt64 ¶ added in v0.25.0
type SliceInt64 []int64
SliceInt64 is a type that implements slog.LogValue and which will format a slice for inclusion in logging, but lazily so that no work is done unless a log line is actually emitted.
func (SliceInt64) LogValue ¶ added in v0.25.0
func (s SliceInt64) LogValue() slog.Value
type SliceString ¶ added in v0.25.0
type SliceString []string
SliceString is a type that implements slog.LogValue and which will format a slice for inclusion in logging, but lazily so that no work is done unless a log line is actually emitted.
func (SliceString) LogValue ¶ added in v0.25.0
func (s SliceString) LogValue() slog.Value
type SlogMessageOnlyHandler ¶
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).