Documentation ¶
Index ¶
- Variables
- func AddHook(hook logrus.Hook)
- func Caller() (file string, line int)
- func Debug(args ...interface{})
- func Debugf(format string, args ...interface{})
- func Debugln(args ...interface{})
- func Decorate(logger *logrus.Entry) func() *logrus.Entry
- func Error(args ...interface{})
- func Errorf(format string, args ...interface{})
- func Errorln(args ...interface{})
- func Fatal(args ...interface{})
- func Fatalf(format string, args ...interface{})
- func Fatalln(args ...interface{})
- func GetHook(name string) (logrus.Hook, error)
- func GetLevel() logrus.Level
- func Info(args ...interface{})
- func Infof(format string, args ...interface{})
- func Infoln(args ...interface{})
- func Log() *logrus.Entry
- func Panic(args ...interface{})
- func Panicf(format string, args ...interface{})
- func Panicln(args ...interface{})
- func Print(args ...interface{})
- func Printf(format string, args ...interface{})
- func Println(args ...interface{})
- func RegisterHook(name string, imp logrus.Hook)
- func SetFormatter(formatter logrus.Formatter)
- func SetLevel(level logrus.Level)
- func SetOutput(out io.Writer)
- func UsingHook(s string) bool
- func Warn(args ...interface{})
- func Warnf(format string, args ...interface{})
- func Warning(args ...interface{})
- func Warningf(format string, args ...interface{})
- func Warningln(args ...interface{})
- func Warnln(args ...interface{})
- func WithError(err error) *logrus.Entry
- func WithField(key string, value interface{}) *logrus.Entry
- func WithFields(fields logrus.Fields) *logrus.Entry
- type Logger
- type MutexWrap
- type StackHook
Constants ¶
This section is empty.
Variables ¶
var ( Config = &loggerConfig{ done: make(chan struct{}), } )
Functions ¶
func Debug ¶
func Debug(args ...interface{})
Debug logruss a message at level Debug on the standard logrusger.
func Debugf ¶
func Debugf(format string, args ...interface{})
Debugf logruss a message at level Debug on the standard logrusger.
func Debugln ¶
func Debugln(args ...interface{})
Debugln logruss a message at level Debug on the standard logrusger.
func Decorate ¶
Decorate appends line, file and function context to the logger and returns a function to call before each log
func Error ¶
func Error(args ...interface{})
Error logruss a message at level Error on the standard logrusger.
func Errorf ¶
func Errorf(format string, args ...interface{})
Errorf logruss a message at level Error on the standard logrusger.
func Errorln ¶
func Errorln(args ...interface{})
Errorln logruss a message at level Error on the standard logrusger.
func Fatal ¶
func Fatal(args ...interface{})
Fatal logruss a message at level Fatal on the standard logrusger.
func Fatalf ¶
func Fatalf(format string, args ...interface{})
Fatalf logruss a message at level Fatal on the standard logrusger.
func Fatalln ¶
func Fatalln(args ...interface{})
Fatalln logruss a message at level Fatal on the standard logrusger.
func Info ¶
func Info(args ...interface{})
Info logruss a message at level Info on the standard logrusger.
func Infof ¶
func Infof(format string, args ...interface{})
Infof logruss a message at level Info on the standard logrusger.
func Infoln ¶
func Infoln(args ...interface{})
Infoln logruss a message at level Info on the standard logrusger.
func Panic ¶
func Panic(args ...interface{})
Panic logruss a message at level Panic on the standard logrusger.
func Panicf ¶
func Panicf(format string, args ...interface{})
Panicf logruss a message at level Panic on the standard logrusger.
func Panicln ¶
func Panicln(args ...interface{})
Panicln logruss a message at level Panic on the standard logrusger.
func Print ¶
func Print(args ...interface{})
Print logruss a message at level Info on the standard logrusger.
func Printf ¶
func Printf(format string, args ...interface{})
Printf logruss a message at level Info on the standard logrusger.
func Println ¶
func Println(args ...interface{})
Println logruss a message at level Info on the standard logrusger.
func RegisterHook ¶
func SetFormatter ¶
SetFormatter sets the standard logrusger formatter.
func Warn ¶
func Warn(args ...interface{})
Warn logruss a message at level Warn on the standard logrusger.
func Warnf ¶
func Warnf(format string, args ...interface{})
Warnf logruss a message at level Warn on the standard logrusger.
func Warning ¶
func Warning(args ...interface{})
Warning logruss a message at level Warn on the standard logrusger.
func Warningf ¶
func Warningf(format string, args ...interface{})
Warningf logruss a message at level Warn on the standard logrusger.
func Warningln ¶
func Warningln(args ...interface{})
Warningln logruss a message at level Warn on the standard logrusger.
func Warnln ¶
func Warnln(args ...interface{})
Warnln logruss a message at level Warn on the standard logrusger.
func WithError ¶
WithError creates an entry from the standard logrusger and adds an error to it, using the value defined in ErrorKey as key.
func WithField ¶
WithField creates an entry from the standard logrusger and adds a field to it. If you want multiple fields, use `WithFields`.
Note that it doesn't logrus until you call Debug, Print, Info, Warn, Fatal or Panic on the Entry it returns.
func WithFields ¶
WithFields creates an entry from the standard logrusger and adds multiple fields to it. This is simply a helper for `WithField`, invoking it once for each field.
Note that it doesn't logrus until you call Debug, Print, Info, Warn, Fatal or Panic on the Entry it returns.
Types ¶
type Logger ¶
func New ¶
func New() *Logger
Creates a new logrusger. Configuration should be set by changing `Formatter`, `Out` and `Hooks` directly on the default logrusger instance. You can also just instantiate your own:
var logrus = &Logger{ Out: os.Stderr, Formatter: new(JSONFormatter), Hooks: make(LevelHooks), Level: logrusrus.DebugLevel, }
It's recommended to make this a global instance called `logrus`.
func StandardLogger ¶
func StandardLogger() *Logger
type StackHook ¶
type StackHook struct { // Set levels to CallerLevels for which "caller" value may be set, // providing a single frame of stack. CallerLevels []logrus.Level // Set levels to StackLevels for which "stack" value may be set, // providing the full stack (minus logrus). StackLevels []logrus.Level }
StackHook is an implementation of logrus.Hook interface.
func NewStackHook ¶
NewHook is the initializer for StackHook{} (implementing logrus.Hook). Set levels to callerLevels for which "caller" value may be set, providing a single frame of stack. Set levels to stackLevels for which "stack" value may be set, providing the full stack (minus logrus).
func StandardStackHook ¶
func StandardStackHook() StackHook
StackHook is a convenience initializer for StackHook{} with default args.