loggers

package
v0.75.1 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2020 License: Apache-2.0 Imports: 12 Imported by: 59

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Counts ERROR logs to the global jww logger.
	GlobalErrorCounter *jww.Counter
)

Functions

func InitGlobalLogger added in v0.54.0

func InitGlobalLogger(stdoutThreshold, logThreshold jww.Threshold, outHandle, logHandle io.Writer)

InitGlobalLogger initializes the global logger, used in some rare cases.

func LoggerToWriterWithPrefix added in v0.75.0

func LoggerToWriterWithPrefix(logger *log.Logger, prefix string) io.Writer

Types

type IgnorableLogger added in v0.73.0

type IgnorableLogger struct {
	// contains filtered or unexported fields
}

IgnorableLogger is a logger that ignores certain log statements.

func NewIgnorableLogger added in v0.73.0

func NewIgnorableLogger(logger *Logger, statements ...string) IgnorableLogger

NewIgnorableLogger wraps the given logger and ignores the log statement IDs given.

func (IgnorableLogger) Errorf added in v0.73.0

func (l IgnorableLogger) Errorf(statementID, format string, v ...interface{})

type Logger added in v0.54.0

type Logger struct {
	*jww.Notepad

	// The writer that represents stdout.
	// Will be ioutil.Discard when in quiet mode.
	Out io.Writer

	ErrorCounter *jww.Counter
	WarnCounter  *jww.Counter
	// contains filtered or unexported fields
}

Logger wraps a *loggers.Logger and some other related logging state.

func NewBasicLogger added in v0.75.0

func NewBasicLogger(t jww.Threshold) *Logger

NewBasicLogger creates a new basic logger writing to Stdout.

func NewBasicLoggerForWriter added in v0.75.0

func NewBasicLoggerForWriter(t jww.Threshold, w io.Writer) *Logger

NewBasicLoggerForWriter creates a new basic logger writing to w.

func NewDebugLogger

func NewDebugLogger() *Logger

NewDebugLogger is a convenience function to create a debug logger.

func NewErrorLogger

func NewErrorLogger() *Logger

NewErrorLogger is a convenience function to create an error logger.

func NewInfoLogger added in v0.75.0

func NewInfoLogger() *Logger

NewInfoLogger is a convenience function to create a info logger.

func NewLogger added in v0.54.0

func NewLogger(stdoutThreshold, logThreshold jww.Threshold, outHandle, logHandle io.Writer, saveErrors bool) *Logger

NewLogger creates a new Logger for the given thresholds

func NewWarningLogger

func NewWarningLogger() *Logger

NewWarningLogger is a convenience function to create a warning logger.

func (*Logger) Errors added in v0.54.0

func (l *Logger) Errors() string

func (*Logger) PrintTimer added in v0.60.0

func (l *Logger) PrintTimer(start time.Time, name string)

func (*Logger) PrintTimerIfDelayed added in v0.60.0

func (l *Logger) PrintTimerIfDelayed(start time.Time, name string)

PrintTimerIfDelayed prints a time statement to the FEEDBACK logger if considerable time is spent.

func (*Logger) Reset added in v0.54.0

func (l *Logger) Reset()

Reset resets the logger's internal state.

Jump to

Keyboard shortcuts

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