Documentation ¶
Index ¶
- Variables
- 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 Info(args ...interface{})
- func Infof(format string, args ...interface{})
- func InitLog(logFileName, LogLevel, LogPath string, formatter *Formatter, ...)
- func InitOutToFile(logPath, logFileName string) error
- func NewRotateFileHook(config RotateFileConfig) (logrus.Hook, error)
- func Panic(args ...interface{})
- func Warn(args ...interface{})
- func Warnf(format string, args ...interface{})
- type Formatter
- type RotateFileConfig
- type RotateFileHook
Constants ¶
This section is empty.
Variables ¶
View Source
var (
Logger = logrus.New()
)
Functions ¶
func InitOutToFile ¶
func NewRotateFileHook ¶
func NewRotateFileHook(config RotateFileConfig) (logrus.Hook, error)
Types ¶
type Formatter ¶
type Formatter struct { // Timestamp format TimestampFormat string // Available standard keys: time, msg, lvl // Also can include custom fields but limited to strings. // All of fields need to be wrapped inside %% i.e %time% %msg% LogFormat string // Disables the truncation of the level text to 4 characters. DisableLevelTruncation bool }
Formatter implements logrus.Formatter interface.
type RotateFileConfig ¶
type RotateFileHook ¶
type RotateFileHook struct { Config RotateFileConfig // contains filtered or unexported fields }
func (*RotateFileHook) Levels ¶
func (hook *RotateFileHook) Levels() []logrus.Level
Click to show internal directories.
Click to hide internal directories.