testlogger

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package testlogger wraps logr.Logger to allow for writing test assertions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

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

Logger wraps logr.Logger in a way that captures logs for test assertions.

func New deprecated

func New(t *testing.T) *Logger

Deprecated: Use plog.TestLogger or plog.TestZapr instead. This is meant for old tests only.

func NewLegacy deprecated added in v0.13.0

func NewLegacy(t *testing.T) *Logger

Deprecated: Use plog.TestLogger or plog.TestZapr instead. This is meant for old tests only.

func (*Logger) Expect added in v0.7.0

func (l *Logger) Expect(expected []string)

Expect the emitted lines to match known-good output.

func (*Logger) Lines

func (l *Logger) Lines() []string

Lines returns the lines written to the test logger.

Jump to

Keyboard shortcuts

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