srvtest

package
v0.0.0-...-cf8a7de Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLogger

func NewLogger(t *testing.T, options ...LoggerOption) *log.Logger

Logger returns a *log.Logger that outputs all results using [testing/*t.Log].

Types

type ErrorStrategy

type ErrorStrategy int

ErrorStrategy defines what a [Logger] should do if a message is logged at the error level.

const (
	// Ignore will take no action. This is the default.
	Ignore ErrorStrategy = iota
	// Fail will mark the test as failed, but continue.
	Fail
	// FailNow will mark the test as failed and exit immediately.
	FailNow
)

type LoggerOption

type LoggerOption func(*testHandler)

func WithErrorStrategy

func WithErrorStrategy(es ErrorStrategy) LoggerOption

Jump to

Keyboard shortcuts

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