Documentation
¶
Index ¶
- Variables
- func AddHook(hook logrus.Hook)
- func Debug(args ...interface{})
- func Debugf(format string, args ...interface{})
- func Error(args ...interface{})
- func Errorf(format string, args ...interface{})
- func Fatal(args ...interface{})
- func Fatalf(format string, args ...interface{})
- func GetLevel() logrus.Level
- func Info(args ...interface{})
- func Infof(format string, args ...interface{})
- func Panic(args ...interface{})
- func Panicf(format string, args ...interface{})
- func Print(args ...interface{})
- func Printf(format string, args ...interface{})
- func SetConfig(cfg *Config)
- func Warn(args ...interface{})
- func Warnf(format string, args ...interface{})
- func Warning(args ...interface{})
- func Warningf(format string, args ...interface{})
- type CallerHook
- type Config
- type Logger
Constants ¶
This section is empty.
Variables ¶
var DefaultConfig = &Config{ Format: "text", Formatter: &logrus.TextFormatter{ TimestampFormat: "2006-01-02 15:04:05.999", FullTimestamp: true, }, Level: "debug", Output: os.Stderr, }
DefaultConfig default config
Functions ¶
func Debug ¶
func Debug(args ...interface{})
Debug logs a message at level Debug on the standard logger.
func Debugf ¶
func Debugf(format string, args ...interface{})
Debugf 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 Errorf ¶
func Errorf(format string, args ...interface{})
Errorf 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 Fatalf ¶
func Fatalf(format string, args ...interface{})
Fatalf 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 Infof ¶
func Infof(format string, args ...interface{})
Infof logs a message at level Info on the standard logger.
func Panic ¶
func Panic(args ...interface{})
Panic logs a message at level Panic on the standard logger.
func Panicf ¶
func Panicf(format string, args ...interface{})
Panicf logs a message at level Panic on the standard logger.
func Print ¶
func Print(args ...interface{})
Print logs a message at level Info on the standard logger.
func Printf ¶
func Printf(format string, args ...interface{})
Printf logs a message at level Info on the standard logger.
func Warn ¶
func Warn(args ...interface{})
Warn logs a message at level Warn on the standard logger.
func Warnf ¶
func Warnf(format string, args ...interface{})
Warnf logs a message at level Warn on the standard logger.
Types ¶
type CallerHook ¶
type CallerHook struct {
}
CallerHook represents a caller hook of logrus
func (*CallerHook) Fire ¶
func (hook *CallerHook) Fire(entry *logrus.Entry) error
Fire adds a callers field in logger instance
func (*CallerHook) Levels ¶
func (hook *CallerHook) Levels() []logrus.Level
Levels returns support levels
type Config ¶
type Config struct {
Format string `mapstructure:"log-format"`
Formatter logrus.Formatter
Level string `mapstructure:"log-level"`
Output io.Writer
}
Config log config
type Logger ¶
type Logger interface {
Debug(args ...interface{})
Print(args ...interface{})
Info(args ...interface{})
Warn(args ...interface{})
Warning(args ...interface{})
Error(args ...interface{})
Panic(args ...interface{})
Fatal(args ...interface{})
Debugf(format string, args ...interface{})
Printf(format string, args ...interface{})
Infof(format string, args ...interface{})
Warnf(format string, args ...interface{})
Warningf(format string, args ...interface{})
Errorf(format string, args ...interface{})
Panicf(format string, args ...interface{})
Fatalf(format string, args ...interface{})
}
Logger wrappers access to logger instance