testlog

package
v1.15.10 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2025 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package testlog provides a log handler for unit tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Logger

func Logger(t T, level slog.Level) log.Logger

Logger returns a logger which logs to the unit test log of t.

Types

type T added in v1.15.8

type T interface {
	Logf(format string, args ...any)
	Helper()
}

T wraps methods from testing.T used by the test logger into an interface. It is specified so that unit tests can instantiate the logger with an implementation of T which can capture the output of logging statements from T.Logf, as this cannot be using testing.T.

Jump to

Keyboard shortcuts

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