logger

package
v0.0.0-...-ea68c78 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOutput

func GetOutput() (io.Writer, error)

func LogDebug

func LogDebug(args ...interface{})

LogDebug logs a message at level Debug on the standard logger.Log

func LogDebugf

func LogDebugf(format string, args ...interface{})

LogDebugf logs a message at level Debug on the standard logger.Log

func LogDebugln

func LogDebugln(args ...interface{})

LogDebugln logs a message at level Debug on the standard logger.Log

func LogError

func LogError(args ...interface{})

LogError logs a message at level Error on the standard logger.Log

func LogErrorf

func LogErrorf(format string, args ...interface{})

LogErrorf logs a message at level Error on the standard logger.Log

func LogErrorln

func LogErrorln(args ...interface{})

LogErrorln logs a message at level Error on the standard logger.Log

func LogFatal

func LogFatal(args ...interface{})

LogFatal logs a message at level Fatal on the standard logger then the process will exit with status set to 1.

func LogFatalf

func LogFatalf(format string, args ...interface{})

LogFatalf logs a message at level Fatal on the standard logger then the process will exit with status set to 1.

func LogFatalln

func LogFatalln(args ...interface{})

LogFatalln logs a message at level Fatal on the standard logger then the process will exit with status set to 1.

func LogInfo

func LogInfo(args ...interface{})

LogInfo logs a message at level Info on the standard logger.Log

func LogInfof

func LogInfof(format string, args ...interface{})

LogInfof logs a message at level Info on the standard logger.Log

func LogInfoln

func LogInfoln(args ...interface{})

LogInfoln logs a message at level Info on the standard logger.Log

func LogPanic

func LogPanic(args ...interface{})

LogPanic logs a message at level Panic on the standard logger.Log

func LogPanicf

func LogPanicf(format string, args ...interface{})

LogPanicf logs a message at level Panic on the standard logger.Log

func LogPanicln

func LogPanicln(args ...interface{})

LogPanicln logs a message at level Panic on the standard logger.Log

func LogPrint

func LogPrint(args ...interface{})

LogPrint logs a message at level Info on the standard logger.Log

func LogPrintf

func LogPrintf(format string, args ...interface{})

LogPrintf logs a message at level Info on the standard logger.Log

func LogPrintln

func LogPrintln(args ...interface{})

LogPrintln logs a message at level Info on the standard logger.Log

func LogTracef

func LogTracef(format string, args ...interface{})

LogTracef logs a message at level Trace on the standard logger.Log

func LogTraceln

func LogTraceln(args ...interface{})

LogTraceln logs a message at level Trace on the standard logger.Log

func LogWarn

func LogWarn(args ...interface{})

LogWarn logs a message at level Warn on the standard logger.Log

func LogWarnf

func LogWarnf(format string, args ...interface{})

LogWarnf logs a message at level Warn on the standard logger.Log

func LogWarning

func LogWarning(args ...interface{})

LogWarning logs a message at level Warn on the standard logger.Log

func LogWarningf

func LogWarningf(format string, args ...interface{})

LogWarningf logs a message at level Warn on the standard logger.Log

func LogWarningln

func LogWarningln(args ...interface{})

LogWarningln logs a message at level Warn on the standard logger.Log

func LogWarnln

func LogWarnln(args ...interface{})

LogWarnln logs a message at level Warn on the standard logger.Log

func Printf

func Printf(format string, args ...interface{})

Printf logs a message at level Info on the standard logger.Log

Types

type FieldMap

type FieldMap map[fieldKey]string

type LogFormatter

type LogFormatter struct {

	// Force quoting of all values
	ForceQuote bool

	// DisableQuote disables quoting for all values.
	// DisableQuote will have a lower priority than ForceQuote.
	// If both of them are set to true, quote will be forced on all values.
	DisableQuote bool

	// TimestampFormat to use for display when a full timestamp is printed.
	// The format to use is the same than for time.Format or time.Parse from the standard
	// library.
	// The standard Library already provides a set of predefined format.
	TimestampFormat string

	// The fields are sorted by default for a consistent output. For applications
	// that log extremely frequently and don't use the JSON formatter this may not
	// be desired.
	DisableSorting bool

	// The keys sorting function, when uninitialized it uses sort.Strings.
	SortingFunc func([]string)

	// QuoteEmptyFields will wrap empty fields in quotes if true
	QuoteEmptyFields bool

	// FieldMap allows users to customize the names of keys for default fields.
	// As an example:
	// formatter := &LogFormatter{
	//     FieldMap: FieldMap{
	//         FieldKeyTime:  "@timestamp",
	//         FieldKeyLevel: "@level",
	//         FieldKeyMsg:   "@message"}}
	FieldMap FieldMap
	// contains filtered or unexported fields
}

LogFormatter formats logs into text

func NewLogFormatter

func NewLogFormatter() *LogFormatter

func (*LogFormatter) Format

func (f *LogFormatter) Format(entry *logrus.Entry) ([]byte, error)

Format renders a single log entry

type Logger

type Logger struct {
}

func (Logger) LogDebug

func (l Logger) LogDebug(args ...interface{})

LogDebug logs a message at level Debug on the standard logger.

func (Logger) LogDebugf

func (l Logger) LogDebugf(format string, args ...interface{})

LogDebugf logs a message at level Debug on the standard logger.

func (Logger) LogDebugln

func (l Logger) LogDebugln(args ...interface{})

LogDebugln logs a message at level Debug on the standard logger.

func (Logger) LogError

func (l Logger) LogError(args ...interface{})

LogError logs a message at level Error on the standard logger.

func (Logger) LogErrorf

func (l Logger) LogErrorf(format string, args ...interface{})

LogErrorf logs a message at level Error on the standard logger.

func (Logger) LogErrorln

func (l Logger) LogErrorln(args ...interface{})

LogErrorln logs a message at level Error on the standard logger.

func (Logger) LogFatal

func (l Logger) LogFatal(args ...interface{})

LogFatal logs a message at level Fatal on the standard logger then the process will exit with status set to 1.

func (Logger) LogFatalf

func (l Logger) LogFatalf(format string, args ...interface{})

LogFatalf logs a message at level Fatal on the standard logger then the process will exit with status set to 1.

func (Logger) LogFatalln

func (l Logger) LogFatalln(args ...interface{})

LogFatalln logs a message at level Fatal on the standard logger then the process will exit with status set to 1.

func (Logger) LogInfo

func (l Logger) LogInfo(args ...interface{})

LogInfo logs a message at level Info on the standard logger.

func (Logger) LogInfof

func (l Logger) LogInfof(format string, args ...interface{})

LogInfof logs a message at level Info on the standard logger.

func (Logger) LogInfoln

func (l Logger) LogInfoln(args ...interface{})

LogInfoln logs a message at level Info on the standard logger.

func (Logger) LogPanic

func (l Logger) LogPanic(args ...interface{})

LogPanic logs a message at level Panic on the standard logger.

func (Logger) LogPanicf

func (l Logger) LogPanicf(format string, args ...interface{})

LogPanicf logs a message at level Panic on the standard logger.

func (Logger) LogPanicln

func (l Logger) LogPanicln(args ...interface{})

LogPanicln logs a message at level Panic on the standard logger.

func (Logger) LogPrint

func (l Logger) LogPrint(args ...interface{})

LogPrint logs a message at level Info on the standard logger.

func (Logger) LogPrintf

func (l Logger) LogPrintf(format string, args ...interface{})

LogPrintf logs a message at level Info on the standard logger.

func (Logger) LogPrintln

func (l Logger) LogPrintln(args ...interface{})

LogPrintln logs a message at level Info on the standard logger.

func (Logger) LogTracef

func (l Logger) LogTracef(format string, args ...interface{})

LogTracef logs a message at level Trace on the standard logger.

func (Logger) LogTraceln

func (l Logger) LogTraceln(args ...interface{})

LogTraceln logs a message at level Trace on the standard logger.

func (Logger) LogWarn

func (l Logger) LogWarn(args ...interface{})

LogWarn logs a message at level Warn on the standard logger.

func (Logger) LogWarnf

func (l Logger) LogWarnf(format string, args ...interface{})

LogWarnf logs a message at level Warn on the standard logger.

func (Logger) LogWarning

func (l Logger) LogWarning(args ...interface{})

LogWarning logs a message at level Warn on the standard logger.

func (Logger) LogWarningf

func (l Logger) LogWarningf(format string, args ...interface{})

LogWarningf logs a message at level Warn on the standard logger.

func (Logger) LogWarningln

func (l Logger) LogWarningln(args ...interface{})

LogWarningln logs a message at level Warn on the standard logger.

func (Logger) LogWarnln

func (l Logger) LogWarnln(args ...interface{})

LogWarnln logs a message at level Warn on the standard logger.

func (Logger) Printf

func (l Logger) Printf(format string, args ...interface{})

Printf logs a message at level Info on the standard logger.

Jump to

Keyboard shortcuts

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