Back to

Package loggers

Latest Go to latest

The latest major version is .

Published: Jul 23, 2020 | License: Apache-2.0 | Module:



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

func InitGlobalLogger

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

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

type IgnorableLogger

type IgnorableLogger struct {
	// contains filtered or unexported fields

IgnorableLogger is a logger that ignores certain log statements.

func NewIgnorableLogger

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

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

func (IgnorableLogger) Errorf

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

type Logger

type Logger struct {

	// 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 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 NewLogger

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

func (l *Logger) Errors() string

func (*Logger) PrintTimer

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

func (*Logger) PrintTimerIfDelayed

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

func (l *Logger) Reset()

Reset resets the logger's internal state.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier