Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LogLogger ¶
func LogLogger(t TestLogger) *log.Logger
LogLogger returns a logger that logs to t.
func Logger ¶
func Logger(t TestLogger) *slog.Logger
Logger returns a logger that logs to t at slog.DebugLevel in text format without times and levels.
Types ¶
type MaybeLogger ¶
type MaybeLogger struct {
// contains filtered or unexported fields
}
MaybeLogger makes it easy to temporarily instrument code with debug logging.
func (*MaybeLogger) Attach ¶
func (m *MaybeLogger) Attach(t testing.TB)
func (*MaybeLogger) Disable ¶
func (m *MaybeLogger) Disable()
func (*MaybeLogger) Enable ¶
func (m *MaybeLogger) Enable(t TestLogger)
func (*MaybeLogger) Logf ¶
func (m *MaybeLogger) Logf(fmt string, args ...any)
type TestLogger ¶
TestLogger is the interface implemented by *testing.T and various similar types and adapters.
Click to show internal directories.
Click to hide internal directories.