Documentation ¶
Index ¶
- func Debug(source, message string)
- func Debugf(source, format string, args ...interface{})
- func Error(source, message string)
- func Errorf(source, format string, args ...interface{})
- func Fatal(source, message string)
- func Fatalf(source, format string, args ...interface{})
- func GetLogLevel() logrusPackage.Level
- func GetLogLevelAsString() string
- func Info(source, message string)
- func Infof(source, format string, args ...interface{})
- func NewErrorRotatorFileHook(config RotatorFileConfig) logrusPackage.Hook
- func NewOutputRotatorFileHook(config RotatorFileConfig) logrusPackage.Hook
- func Panic(source, message string)
- func Panicf(source, format string, args ...interface{})
- func RegisterErrorRotator(config RotatorFileConfig)
- func RegisterOutputRotator(config RotatorFileConfig)
- func RegisterRotators(outputRotatorConfig RotatorFileConfig, errorRotatorConfig RotatorFileConfig)
- func SetLogLevel(level logrusPackage.Level)
- func SetLogLevelFromString(levelAsString string)
- func Trace(source, message string)
- func Tracef(source, format string, args ...interface{})
- func Warn(source, message string)
- func Warnf(source, format string, args ...interface{})
- type ErrorRotatorFileHook
- type OutputRotatorFileHook
- type RotatorFileConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Debugf ¶
func Debugf(source, format string, args ...interface{})
Debugf allows to print out message in the Debug type logger with given format
func Errorf ¶
func Errorf(source, format string, args ...interface{})
Errorf allows to print out message in the Error type logger with given format
func Fatalf ¶
func Fatalf(source, format string, args ...interface{})
Fatalf allows to print out message in the Fatal type logger with given format
func GetLogLevel ¶
func GetLogLevel() logrusPackage.Level
GetLogLevel return current log level as a valid logrus level
func GetLogLevelAsString ¶
func GetLogLevelAsString() string
GetLogLevelAsString return current log level as string
func Infof ¶
func Infof(source, format string, args ...interface{})
Infof allows to print out message in the Info type logger with given format
func NewErrorRotatorFileHook ¶
func NewErrorRotatorFileHook(config RotatorFileConfig) logrusPackage.Hook
NewErrorRotatorFileHook creates new instance of rotator file hook (STDERR)
func NewOutputRotatorFileHook ¶
func NewOutputRotatorFileHook(config RotatorFileConfig) logrusPackage.Hook
NewOutputRotatorFileHook creates new instance of rotator file hook (STDOUT)
func Panicf ¶
func Panicf(source, format string, args ...interface{})
Panicf allows to print out message in the Panic type logger with given format
func RegisterErrorRotator ¶
func RegisterErrorRotator(config RotatorFileConfig)
RegisterErrorRotator register `error` log rotator
func RegisterOutputRotator ¶
func RegisterOutputRotator(config RotatorFileConfig)
RegisterOutputRotator register `output` log rotator
func RegisterRotators ¶
func RegisterRotators(outputRotatorConfig RotatorFileConfig, errorRotatorConfig RotatorFileConfig)
RegisterRotators register both `output` and `error` log rotators
func SetLogLevel ¶
func SetLogLevel(level logrusPackage.Level)
SetLogLevel sets log level from a list of valid logrus levels
func SetLogLevelFromString ¶
func SetLogLevelFromString(levelAsString string)
SetLogLevelFromString sets log level from string
Types ¶
type ErrorRotatorFileHook ¶
type ErrorRotatorFileHook struct { // Configuration defines rotator configuration Configuration RotatorFileConfig // contains filtered or unexported fields }
ErrorRotatorFileHook represents structure of `error` file hook
func (*ErrorRotatorFileHook) Fire ¶
func (hook *ErrorRotatorFileHook) Fire(entry *logrusPackage.Entry) error
Fire fires writer event
func (*ErrorRotatorFileHook) Levels ¶
func (hook *ErrorRotatorFileHook) Levels() []logrusPackage.Level
Levels returns list of levels which should be processed by the rotator hook
type OutputRotatorFileHook ¶
type OutputRotatorFileHook struct { // Configuration defines rotator configuration Configuration RotatorFileConfig // contains filtered or unexported fields }
OutputRotatorFileHook represents structure of `output` file hook
func (*OutputRotatorFileHook) Fire ¶
func (hook *OutputRotatorFileHook) Fire(entry *logrusPackage.Entry) error
Fire fires writer event
func (*OutputRotatorFileHook) Levels ¶
func (hook *OutputRotatorFileHook) Levels() []logrusPackage.Level
Levels returns list of levels which should be processed by the rotator hook
type RotatorFileConfig ¶
type RotatorFileConfig struct { // FileName defines output file name FileName string // MaxSize defines maximum log size in megabytes MaxSize uint // MaxBackups defines maximum number of backups for one file MaxBackups uint // MaxAge defines maximum age of log in days MaxAge uint // Level defines log level Level logrusPackage.Level // Formatter defines formatter used by rotator Formatter logrusPackage.Formatter // Compress defines whether logs should be compressed Compress bool }
RotatorFileConfig represents configuration for log rotation of a file