log

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

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

Debug log formatted message at debug level

func Error

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

Error log formatted message at error level

func Fatal added in v0.2.0

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

Fatal log formatted message at fatal level Calls os.Exit(1) after logging

func Info

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

Info log formatted message at info level

func IsLevelEnabled added in v0.2.0

func IsLevelEnabled(level Level) bool

IsLevelEnabled checks if the log level of the standard logger is greater than the level param

func SetLevel added in v0.2.0

func SetLevel(level Level)

SetLevel sets the standard logger level.

func SetLevelS added in v0.2.0

func SetLevelS(level string)

SetLevelS sets the standard logger level from string. Level can be: trace, debug, info, error or fatal

func Trace added in v0.2.0

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

Trace log formatted message at trace level

func Warn

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

Warn log formatted message at info level

Types

type Level added in v0.2.0

type Level uint32

Level type

const (
	// FatalLevel level, highest level of severity. Logs and then calls `logger.Exit(1)`. It will exit even if the
	// logging level is set to Panic.
	FatalLevel Level = iota + 1
	// ErrorLevel level. Logs. Used for errors that should definitely be noted.
	// Commonly used for hooks to send errors to an error tracking service.
	ErrorLevel
	// WarnLevel level. Non-critical entries that deserve eyes.
	WarnLevel
	// InfoLevel level. General operational entries about what's going on inside the
	// application.
	InfoLevel
	// DebugLevel level. Usually only enabled when debugging. Very verbose logging.
	DebugLevel
	// TraceLevel level. Designates finer-grained informational events than the Debug.
	TraceLevel
)

These are the different logging levels. You can set the logging level to log on your instance of logger, obtained with `logrus.New()`.

Jump to

Keyboard shortcuts

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