Documentation ¶
Overview ¶
Package log provides simple logging to console, file and syslog
Index ¶
- func Alert(args ...interface{})
- func Alertf(pattern string, args ...interface{})
- func CaptureStdLog()
- func Critical(args ...interface{})
- func Criticalf(pattern string, args ...interface{})
- func Debug(args ...interface{})
- func Debugf(pattern string, args ...interface{})
- func Error(args ...interface{})
- func Errorf(pattern string, args ...interface{})
- func Fatal(args ...interface{})
- func Fatalf(pattern string, args ...interface{})
- func Info(args ...interface{})
- func Infof(pattern string, args ...interface{})
- func InitFile(file string, level Level)
- func InitSyslog(tag string, level Level) error
- func Notice(args ...interface{})
- func Noticef(pattern string, args ...interface{})
- func RestoreStdLog()
- func SetConsoleLevel(level Level)
- func SetMaxMessagesPerSecond(m int)
- func SetSyslogLevel(level Level)
- func Warning(args ...interface{})
- func Warningf(pattern string, args ...interface{})
- type Level
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CaptureStdLog ¶
func CaptureStdLog()
CaptureStdLog does what the name says. It means that any message sent to standard logger will be parsed via Write
func Fatalf ¶
func Fatalf(pattern string, args ...interface{})
Fatalf outputs formatted message and terminates application
func InitSyslog ¶
InitSyslog should be called before sending messages to Syslog
func RestoreStdLog ¶
func RestoreStdLog()
RestoreStdLog restores standard logger. Any message to it will be again sent to Stdout
func SetConsoleLevel ¶
func SetConsoleLevel(level Level)
SetConsoleLevel sets log level which will be written into stdout
func SetMaxMessagesPerSecond ¶
func SetMaxMessagesPerSecond(m int)
SetMaxMessagesPerSecond sets limit for messages per seconds. All messages above the limit will be discarded Set m = 0 to turn off the limit (default)
func SetSyslogLevel ¶
func SetSyslogLevel(level Level)
SetSyslogLevel can be used to change Syslog messages level filter