package testlog

import "github.com/ethereum/go-ethereum/internal/testlog"

Package testlog provides a log handler for unit tests.

Index

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

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.

Source Files

testlog.go

Version
v1.16.1 (latest)
Published
Jul 2, 2025
Platform
linux/amd64
Imports
6 packages
Last checked
2 days ago

Tools for package owners.