Documentation ¶
Index ¶
- Variables
- func Debugf(format string, args ...interface{})
- func Errorf(format string, args ...interface{})
- func Fatalf(format string, args ...interface{})
- func Infof(format string, args ...interface{})
- func Panicf(format string, args ...interface{})
- func Printf(format string, args ...interface{})
- func Tracef(format string, args ...interface{})
- func Warnf(format string, args ...interface{})
- func Warningf(format string, args ...interface{})
- type ILogger
- type LineHook
- type Logger
- func (l *Logger) EnableSource()
- func (l *Logger) HookToFile(logPath string, maxDay uint, format logrus.Formatter)
- func (l *Logger) HookToSysLog(network, raddr string, priority slog.Priority, tag string) error
- func (l *Logger) RemoveHook(h logrus.Hook)
- func (l *Logger) ToFile(logPath string, maxDay uint, format logrus.Formatter)
- func (l *Logger) ToSysLog(network, raddr string, priority slog.Priority, tag string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultColorTextFormatter = logrus.TextFormatter{ DisableColors: false, ForceColors: true, FullTimestamp: true, EnvironmentOverrideColors: true, TimestampFormat: "2006-01-02 15:04:05.999", }
View Source
var DefaultJsonFormatter = logrus.JSONFormatter{ TimestampFormat: "2006-01-02 15:04:05.999", FieldMap: logrus.FieldMap{ logrus.FieldKeyTime: "@timestamp", logrus.FieldKeyLevel: "@level", logrus.FieldKeyMsg: "@message", logrus.FieldKeyFunc: "@caller", }, }
View Source
var DefaultTextFormatter = logrus.TextFormatter{ DisableColors: true, TimestampFormat: "2006-01-02 15:04:05.999", }
Functions ¶
Types ¶
type ILogger ¶
type ILogger interface { Trace(args ...interface{}) Tracef(format string, args ...interface{}) Debug(args ...interface{}) Debugf(format string, args ...interface{}) Info(args ...interface{}) Infof(format string, args ...interface{}) Print(args ...interface{}) Printf(format string, args ...interface{}) Warn(args ...interface{}) Warnf(format string, args ...interface{}) Warning(args ...interface{}) Warningf(format string, args ...interface{}) Error(args ...interface{}) Errorf(format string, args ...interface{}) Fatal(args ...interface{}) Fatalf(format string, args ...interface{}) Panic(args ...interface{}) Panicf(format string, args ...interface{}) }
type LineHook ¶
type LineHook struct { Field string // contains filtered or unexported fields }
line number hook for log the call context,
type Logger ¶
func (*Logger) EnableSource ¶
func (l *Logger) EnableSource()
func (*Logger) HookToFile ¶
附加输出到文件
func (*Logger) HookToSysLog ¶
日志输入到syslog
func (*Logger) RemoveHook ¶
Click to show internal directories.
Click to hide internal directories.