logger

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoggerBuilder

func LoggerBuilder(t testing.TB) func(*logger.LogConfiguration) (*slog.Logger, error)

LoggerBuilder returns "logger factory" for test t.

Factory function returned by LoggerBuilder returns the same logger for all calls.

func NOP

func NOP() *slog.Logger

NOP returns a logger which doesn't log (ie /dev/null). Use it for tests where valid logger is needed but it's output is not needed.

func New

func New(t testing.TB) *slog.Logger

New returns logger for test t on debug level.

func NewLvl

func NewLvl(t testing.TB, level slog.Level) *slog.Logger

NewLvl returns logger for test t on level "level".

First part of the log line is source location which is invalid for messages logged by the logger (they are correct for the t.Log, t.Error etc calls). Fix needs support from the Go testing lib (see https://github.com/golang/go/issues/59928).

Types

This section is empty.

Jump to

Keyboard shortcuts

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