testutil

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogEntry added in v0.1.5

type LogEntry struct {
	Level   log.Level
	Message string
}

LogEntry represents a captured log entry for testing

type TestLogger

type TestLogger struct {
	log.Logger
	// contains filtered or unexported fields
}

TestLogger wraps log.Logger with test utilities

func MakeLogger

func MakeLogger(t *testing.T, node ...int) *TestLogger

MakeLogger creates a TestLogger for testing

func (*TestLogger) Debug added in v0.1.5

func (tl *TestLogger) Debug(msg string, fields ...log.Field)

func (*TestLogger) Error added in v0.1.5

func (tl *TestLogger) Error(msg string, fields ...log.Field)

func (*TestLogger) Fatal added in v0.1.5

func (tl *TestLogger) Fatal(msg string, fields ...log.Field)

func (*TestLogger) Info added in v0.1.5

func (tl *TestLogger) Info(msg string, fields ...log.Field)

func (*TestLogger) Intercept

func (tl *TestLogger) Intercept(hook func(entry LogEntry))

Intercept sets a hook function that receives all log entries

func (*TestLogger) Silence

func (t *TestLogger) Silence()

Silence stops all logging output

func (*TestLogger) Trace

func (tl *TestLogger) Trace(msg string, fields ...log.Field)

func (*TestLogger) Verbo

func (tl *TestLogger) Verbo(msg string, fields ...log.Field)

func (*TestLogger) Warn added in v0.1.5

func (tl *TestLogger) Warn(msg string, fields ...log.Field)

Jump to

Keyboard shortcuts

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