Documentation ¶
Overview ¶
Package log contains an improved API and utilities for github.com/sirupsen/logrus
Index ¶
- func Debug(v ...interface{})
- func Debugf(fmt string, v ...interface{})
- func Debugln(v ...interface{})
- func Error(v ...interface{})
- func Errorf(fmt string, v ...interface{})
- func Errorln(v ...interface{})
- func Fatal(v ...interface{})
- func Fatalf(fmt string, v ...interface{})
- func Fatalln(v ...interface{})
- func Info(v ...interface{})
- func Infof(fmt string, v ...interface{})
- func Infoln(v ...interface{})
- func Trace(v ...interface{})
- func Tracef(fmt string, v ...interface{})
- func Traceln(v ...interface{})
- func Warn(v ...interface{})
- func Warnf(fmt string, v ...interface{})
- func Warnln(v ...interface{})
- type F
- type Level
- type LevelHooks
- type Loggable
- type Logger
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Debugf ¶
func Debugf(fmt string, v ...interface{})
Debugf provides fmt.Printf-like formatting for a call to Trace
func Debugln ¶
func Debugln(v ...interface{})
Debugln calls Trace, adding a newline to the log output.
func Errorf ¶
func Errorf(fmt string, v ...interface{})
Errorf provides fmt.Printf-like formatting for a call to Trace
func Errorln ¶
func Errorln(v ...interface{})
Errorln calls Trace, adding a newline to the log output.
func Fatalf ¶
func Fatalf(fmt string, v ...interface{})
Fatalf provides fmt.Printf-like formatting for a call to Fatal.
func Fatalln ¶
func Fatalln(v ...interface{})
Fatalln calls Fatal, appending a newline to the log output.
func Infof ¶
func Infof(fmt string, v ...interface{})
Infof provides fmt.Printf-like formatting for a call to Trace
func Tracef ¶
func Tracef(fmt string, v ...interface{})
Tracef provides fmt.Printf-like formatting for a call to Trace
func Traceln ¶
func Traceln(v ...interface{})
Traceln calls Trace, adding a newline to the log output.
Types ¶
type Level ¶
type Level uint8
Level indicates the minimum severity threshold for logging.
const ( // FatalLevel logs and then calls `os.Exit(1)`. FatalLevel Level = iota // ErrorLevel is used for errors that should definitely be noted. // Commonly used for hooks to send errors to an error tracking service. ErrorLevel // WarnLevel is for non-critical entries that deserve eyes. WarnLevel // InfoLevel provides general operational entries about what's going on inside the // application. InfoLevel // DebugLevel is used to report application state for debugging perposes. DebugLevel // TraceLevel is used to trace the execution steps of an application for debugging // or optimization purposes. TraceLevel )
type LevelHooks ¶
type LevelHooks = logrus.LevelHooks
LevelHooks is a collection of hooks that are synchronously triggered for each logging event.
type Loggable ¶
type Loggable interface {
Loggable() map[string]interface{}
}
Loggable types provide a loggable representation of their internal state.
type Logger ¶
type Logger interface { Fatal(...interface{}) Fatalf(string, ...interface{}) Fatalln(...interface{}) Trace(...interface{}) Tracef(string, ...interface{}) Traceln(...interface{}) Debug(...interface{}) Debugf(string, ...interface{}) Debugln(...interface{}) Info(...interface{}) Infof(string, ...interface{}) Infoln(...interface{}) Warn(...interface{}) Warnf(string, ...interface{}) Warnln(...interface{}) Error(...interface{}) Errorf(string, ...interface{}) Errorln(...interface{}) With(Loggable) Logger WithError(error) Logger WithField(string, interface{}) Logger WithFields(logrus.Fields) Logger }
Logger provides observability
func WrapLogrus ¶
func WrapLogrus(l logrus.Ext1FieldLogger) Logger
WrapLogrus is a convenience function
Directories ¶
Path | Synopsis |
---|---|
Package doctest contains utilities for mocking logs in unit tests.
|
Package doctest contains utilities for mocking logs in unit tests. |
util
|
|
zap
Package zaputil contains utilities for working with go.uber.org/zap.
|
Package zaputil contains utilities for working with go.uber.org/zap. |