log

package
v0.0.0-...-415d676 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StdOutErrMultiLoggerProviderSet = wire.NewSet(
	ProvideStdOutErrMultiLogger,
)

StdOutErrMultiLoggerProviderSet provides a MultiLogger to stdout/stderr

Functions

This section is empty.

Types

type Level

type Level int

Level is an enum of log levels

const (
	Debug Level = 0 + iota
	Info
	Warning
	Error
	Critical
)

Values for LogLevel

type MultiLogger

type MultiLogger struct {
	PrintLogger *log.Logger
	ErrorLogger *log.Logger
	PrintLevel  Level
	ErrorLevel  Level
}

MultiLogger provides a three tiered (ignore, print, error) logger wrapper around log.MultiLogger

func ProvideStdOutErrMultiLogger

func ProvideStdOutErrMultiLogger(debugMode config.DebugMode) (*MultiLogger, func())

ProvideStdOutErrMultiLogger creates a custom MultiLogger based on whether we are running in debug mode

func (MultiLogger) Criticalf

func (l MultiLogger) Criticalf(format string, values ...interface{})

Criticalf prints a debug message to the appropriate logger

func (MultiLogger) Debugf

func (l MultiLogger) Debugf(format string, values ...interface{})

Debugf prints a debug message to the appropriate logger

func (MultiLogger) Errorf

func (l MultiLogger) Errorf(format string, values ...interface{})

Errorf prints a debug message to the appropriate logger

func (MultiLogger) Infof

func (l MultiLogger) Infof(format string, values ...interface{})

Infof prints a debug message to the appropriate logger

func (MultiLogger) SetFlags

func (l MultiLogger) SetFlags(flags int)

SetFlags sets the flags for both wrapped loggers

func (MultiLogger) SetOutput

func (l MultiLogger) SetOutput(printOutput io.Writer, errorOutput io.Writer)

SetOutput sets the outputs for the print and error output loggers

func (MultiLogger) SetPrefix

func (l MultiLogger) SetPrefix(prefix string)

SetPrefix sets the prefix for both wrapped loggers

func (MultiLogger) Warningf

func (l MultiLogger) Warningf(format string, values ...interface{})

Warningf prints a debug message to the appropriate logger

Jump to

Keyboard shortcuts

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