hugo: github.com/gohugoio/hugo/common/loggers Index | Files

package loggers

import "github.com/gohugoio/hugo/common/loggers"

Index

Package Files

loggers.go

Variables

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

func InitGlobalLogger Uses

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

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

type Logger Uses

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 NewDebugLogger Uses

func NewDebugLogger() *Logger

NewDebugLogger is a convenience function to create a debug logger.

func NewErrorLogger Uses

func NewErrorLogger() *Logger

NewErrorLogger is a convenience function to create an error logger.

func NewLogger Uses

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

NewLogger creates a new Logger for the given thresholds

func NewWarningLogger Uses

func NewWarningLogger() *Logger

NewWarningLogger is a convenience function to create a warning logger.

func (*Logger) Errors Uses

func (l *Logger) Errors() string

func (*Logger) PrintTimer Uses

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

func (*Logger) PrintTimerIfDelayed Uses

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 Uses

func (l *Logger) Reset()

Reset resets the logger's internal state.

Package loggers imports 11 packages (graph) and is imported by 128 packages. Updated 2019-11-29. Refresh now. Tools for package owners.