slogutil

package
v0.29.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2025 License: MPL-2.0 Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NoLevelTime      = removeReplaceAttrFunc(slog.LevelKey, slog.TimeKey)           //nolint:gochecknoglobals
	NoLevelTimeJobID = removeReplaceAttrFunc(slog.LevelKey, slog.TimeKey, "job_id") //nolint:gochecknoglobals
)

Standard functions suitable for use with slog.HandlerOptions.ReplaceAttr that remove certain log keys for better test output stability. Prefer NoLevelTime unless you also have `job_id` in output, then use the latter.

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

Jump to

Keyboard shortcuts

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