logger

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2020 License: Apache-2.0 Imports: 3 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStandardLogger

func NewStandardLogger(w io.Writer) *standardLogger

func NewVerboseLogger

func NewVerboseLogger(w io.Writer) *verboseLogger

Types

type CaptureLogger added in v1.3.0

type CaptureLogger struct {
	Prints []string
	Debugs []string
}

CaptureLogger is a logger that stores all the print and debug messages it sees, useful for testing.

func NewCaptureLogger added in v1.3.0

func NewCaptureLogger() *CaptureLogger

NewCaptureLogger yields a CaptureLogger.

func (*CaptureLogger) Debugf added in v1.3.0

func (cl *CaptureLogger) Debugf(format string, v ...interface{})

Debugf formats a message and appends it to Debugs.

func (*CaptureLogger) Printf added in v1.3.0

func (cl *CaptureLogger) Printf(format string, v ...interface{})

Printf formats a message and appends it to Prints.

type Logger

type Logger interface {
	Printf(format string, v ...interface{})
	Debugf(format string, v ...interface{})
}

Logger represents an interface for a shared logger.

var NopLogger Logger = &nopLogger{}

NopLogger represents a Logger that doesn't do anything.

Jump to

Keyboard shortcuts

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