testutil

package
v0.58.9 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TL

func TL(t *testing.T, opts ...Opt) *logrus.Entry

TL will build and return a test logger

func TestLogger

func TestLogger(t *testing.T, opts ...Opt) (*logrus.Entry, *test.Hook)

TestLogger will build a logger that is useful for debugging it respects levels configured by the 'LOG_LEVEL' env var. It takes opt functions to modify the logger used

Types

type Opt

type Opt func(l *logrus.Logger)

Opt is a function that will modify the logger used

func OptReportCaller

func OptReportCaller(b bool) Opt

OptReportCaller will override the reporting of the calling function info

func OptSetLevel

func OptSetLevel(lvl logrus.Level) Opt

OptSetLevel will override the env var used to configre the logger

Jump to

Keyboard shortcuts

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