testlogging

package
v0.8.0-beta4 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package testlogging implements logger that writes to testing.T log.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Context

func Context(t testingT) context.Context

Context returns a context with attached logger that emits all log entries to go testing.T log output.

func ContextWithLevel

func ContextWithLevel(t testingT, level Level) context.Context

ContextWithLevel returns a context with attached logger that emits all log entries with given log level or above.

func ContextWithLevelAndPrefix added in v0.6.0

func ContextWithLevelAndPrefix(t testingT, level Level, prefix string) context.Context

ContextWithLevelAndPrefix returns a context with attached logger that emits all log entries with given log level or above.

func ContextWithLevelAndPrefixFunc added in v0.6.0

func ContextWithLevelAndPrefixFunc(t testingT, level Level, prefixFunc func() string) context.Context

ContextWithLevelAndPrefixFunc returns a context with attached logger that emits all log entries with given log level or above.

Types

type Level

type Level int

Level specifies log level.

const (
	LevelDebug Level = iota
	LevelInfo
	LevelNotice
	LevelWarning
	LevelError
	LevelFatal
)

log levels.

Jump to

Keyboard shortcuts

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