Documentation
¶
Overview ¶
Package log wraps logrus to include source line/function information
inspired by prometheus/common/log
Index ¶
- func Debug(args ...interface{})
- func Debugln(args ...interface{})
- func Error(args ...interface{})
- func Errorln(args ...interface{})
- func Fatal(args ...interface{})
- func Fatalln(args ...interface{})
- func Info(args ...interface{})
- func Infoln(args ...interface{})
- func SetLevel(level Level)
- func SetOut(out io.Writer)
- func Warn(args ...interface{})
- func Warnln(args ...interface{})
- type Level
- type Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Debug ¶
func Debug(args ...interface{})
Debug logs a message at level Debug on the standard logger.
func Debugln ¶
func Debugln(args ...interface{})
Debugln logs a message at level Debug on the standard logger.
func Error ¶
func Error(args ...interface{})
Error logs a message at level Error on the standard logger.
func Errorln ¶
func Errorln(args ...interface{})
Errorln logs a message at level Error on the standard logger.
func Fatal ¶
func Fatal(args ...interface{})
Fatal logs a message at level Fatal on the standard logger.
func Fatalln ¶
func Fatalln(args ...interface{})
Fatalln logs a message at level Fatal on the standard logger.
func Info ¶
func Info(args ...interface{})
Info logs a message at level Info on the standard logger.
func Infoln ¶
func Infoln(args ...interface{})
Infoln logs a message at level Info on the standard logger.
Types ¶
type Level ¶
type Level uint8
Level describes the log severity level.
const ( // PanicLevel level, highest level of severity. Logs and then calls panic with the // message passed to Debug, Info, ... PanicLevel Level = iota // FatalLevel level. Logs and then calls `os.Exit(1)`. It will exit even if the // logging level is set to Panic. FatalLevel // 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 )
type Logger ¶
type Logger interface {
SetLevel(level Level)
SetOut(out io.Writer)
Debug(...interface{})
Debugln(...interface{})
Info(...interface{})
Infoln(...interface{})
Warn(...interface{})
Warnln(...interface{})
Error(...interface{})
Errorln(...interface{})
Fatal(...interface{})
Fatalln(...interface{})
With(key string, value interface{}) Logger
WithError(err error) Logger
}
Logger is an interface that describes logging.