slog

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: MIT Imports: 9 Imported by: 0

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.

Jump to

Keyboard shortcuts

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