package testing

import "github.com/go-logr/logr/testing"

Index

Types

type NullLogger

type NullLogger struct{}

NullLogger is a logr.Logger that does nothing.

func (NullLogger) Enabled

func (_ NullLogger) Enabled() bool

func (NullLogger) Error

func (_ NullLogger) Error(_ error, _ string, _ ...interface{})

func (NullLogger) Info

func (_ NullLogger) Info(_ string, _ ...interface{})

func (NullLogger) V

func (log NullLogger) V(_ int) logr.Logger

func (NullLogger) WithName

func (log NullLogger) WithName(_ string) logr.Logger

func (NullLogger) WithValues

func (log NullLogger) WithValues(_ ...interface{}) logr.Logger

type TestLogger

type TestLogger struct {
	T *testing.T
}

TestLogger is a logr.Logger that prints through a testing.T object. Only error logs will have any effect.

func (TestLogger) Enabled

func (_ TestLogger) Enabled() bool

func (TestLogger) Error

func (log TestLogger) Error(err error, msg string, args ...interface{})

func (TestLogger) Info

func (_ TestLogger) Info(_ string, _ ...interface{})

func (TestLogger) V

func (log TestLogger) V(v int) logr.Logger

func (TestLogger) WithName

func (log TestLogger) WithName(_ string) logr.Logger

func (TestLogger) WithValues

func (log TestLogger) WithValues(_ ...interface{}) logr.Logger

Source Files

null.go test.go

Version
v0.2.0
Published
Jun 11, 2020
Platform
linux/amd64
Imports
2 packages
Last checked
2 hours ago

Tools for package owners.