Documentation
¶
Overview ¶
Package slog provides structured logging utilities extending the standard log/slog package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTestHandler ¶
func NewTestHandler(tb testing.TB, opts ...TestHandlerOption) slog.Handler
NewTestHandler returns an slog.Handler that writes log records to tb.Output in a compact format: [LEVEL] msg key=value ... Defaults to slog.LevelDebug.
Types ¶
type TestHandlerOption ¶
type TestHandlerOption func(*testHandler)
TestHandlerOption is a functional option for NewTestHandler.
func TestHandlerWithLevel ¶
func TestHandlerWithLevel(level slog.Leveler) TestHandlerOption
TestHandlerWithLevel sets the minimum log level for the test handler.
Click to show internal directories.
Click to hide internal directories.