mocklogger

package
v0.1.6-0...-5c25bcb Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockLogger

type MockLogger struct {
	AllLogContents   string
	FatalLogContents string
	PanicLogContents string
	DebugLogContents string
	InfoLogContents  string
	WarnLogContents  string
	ErrorLogContents string
}

MockLogger is a mocked logger that can be used for testing.

func (*MockLogger) Debugf

func (t *MockLogger) Debugf(msg string, args ...interface{})

Debugf writes to the mock logger.

func (*MockLogger) Errorf

func (t *MockLogger) Errorf(msg string, args ...interface{})

Errorf writes to the mock logger.

func (*MockLogger) Fatalf

func (t *MockLogger) Fatalf(msg string, args ...interface{})

Fatalf writes to the mock logger.

func (*MockLogger) Infof

func (t *MockLogger) Infof(msg string, args ...interface{})

Infof writes to the mock logger.

func (*MockLogger) Panicf

func (t *MockLogger) Panicf(msg string, args ...interface{})

Panicf writes to the mock logger.

func (*MockLogger) Warnf

func (t *MockLogger) Warnf(msg string, args ...interface{})

Warnf writes to the mock logger.

type Provider

type Provider struct {
	MockLogger *MockLogger
}

Provider is a mock logger provider that can be used for testing.

func (*Provider) GetLogger

func (p *Provider) GetLogger(string) log.Logger

GetLogger returns the underlying mock logger.

Jump to

Keyboard shortcuts

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