testlogger

package
v0.36.3 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package testlogger implements a logr.Logger suitable 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 {
	logr.Logger
	// contains filtered or unexported fields
}

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

func New

func New(t *testing.T) *Logger

New returns a new test Logger.

func (*Logger) Expect

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