Documentation
¶
Overview ¶
Package logtest provides a minimal, stdlib-only slog capture handler for asserting on log output in tests. It exists so the transit test suite can verify middleware logging without depending on go-tool-base's pkg/logger.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Buffer ¶
Buffer captures log records in memory. It embeds a *slog.Logger backed by a capturing handler, so callers pass buf.Logger wherever a *slog.Logger is expected and then assert on Entries().
func New ¶
func New() *Buffer
New returns a Buffer that captures every record at any level. Loggers derived from it via With/WithGroup capture into the same buffer.
Click to show internal directories.
Click to hide internal directories.