Documentation
¶
Overview ¶
Package spruce providers an slog.Handler that writes pretty-printed structured logs to a testing.T (or compatible) logger.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewStreamHandler ¶ added in v0.2.0
NewStreamHandler returns a new slog.Handler that writes to w.
func NewStreamLogger ¶ added in v0.2.0
NewStreamLogger returns a slog.Logger that writes to w.
func NewTestHandler ¶ added in v0.2.0
NewTestHandler returns a new slog.Handler that writes to t.
func NewTestLogger ¶ added in v0.2.0
NewTestLogger returns a slog.Logger that writes to t.
Types ¶
type TestingT ¶
type TestingT interface {
Log(...any)
}
TestingT is the subset of testing.TB that is used to write logs.
Click to show internal directories.
Click to hide internal directories.