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

package loggers

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

Index

Package Files

ignorableLogger.go 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.

func LoggerToWriterWithPrefix Uses

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

type IgnorableLogger Uses

type IgnorableLogger interface {
    Logger
    Errorsf(statementID, format string, v ...interface{})
}

IgnorableLogger is a logger that ignores certain log statements.

func NewIgnorableLogger Uses

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

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

type LogCounters Uses

type LogCounters struct {
    ErrorCounter *jww.Counter
    WarnCounter  *jww.Counter
}

type Logger Uses

type Logger interface {
    Printf(format string, v ...interface{})
    Println(v ...interface{})
    PrintTimerIfDelayed(start time.Time, name string)
    Debug() *log.Logger
    Info() *log.Logger
    Infof(format string, v ...interface{})
    Infoln(v ...interface{})
    Warn() *log.Logger
    Warnf(format string, v ...interface{})
    Warnln(v ...interface{})
    Error() *log.Logger
    Errorf(format string, v ...interface{})
    Errorln(v ...interface{})
    Errors() string

    Out() io.Writer

    Reset()

    // Used in tests.
    LogCounters() *LogCounters
}

func NewBasicLogger Uses

func NewBasicLogger(t jww.Threshold) Logger

NewBasicLogger creates a new basic logger writing to Stdout.

func NewBasicLoggerForWriter Uses

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

NewBasicLoggerForWriter creates a new basic logger writing to w.

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

func NewInfoLogger() Logger

NewInfoLogger is a convenience function to create a info 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.

Package loggers imports 12 packages (graph) and is imported by 131 packages. Updated 2020-10-22. Refresh now. Tools for package owners.