Documentation ¶
Overview ¶
Daemons need to log. This package makes that easy, allowing you to configure logging to syslog, a file, or console (stdout), with syslog style log levels.
Since this logging mechanism supports non-syslog output, filtering based on log levels is done in-application, so you'll want to accept debug messages and above in syslog configs.
Simply call SetupLogging(), passing it a reference to a LogConfig struct and start logging! If you happen to log something prior to setting up logging, messages will print to stderr.
Index ¶
- func Alertf(msg string, args ...interface{})
- func Critf(msg string, args ...interface{})
- func Debugf(msg string, args ...interface{})
- func Emergf(msg string, args ...interface{})
- func Errorf(msg string, args ...interface{})
- func Infof(msg string, args ...interface{})
- func IsAlert() bool
- func IsCritical() bool
- func IsDebug() bool
- func IsEmergency() bool
- func IsError() bool
- func IsInfo() bool
- func IsNotice() bool
- func IsTrace() bool
- func IsWarning() bool
- func LogLevel() syslog.Priority
- func Noticef(msg string, args ...interface{})
- func SetupLogging(cfg LogConfig)
- func Tracef(msg string, args ...interface{})
- func Warnf(msg string, args ...interface{})
- type LogConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Alertf ¶
func Alertf(msg string, args ...interface{})
Logs a formatted Alert message. Supports fmt.Sprintf style arguments.
func Critf ¶
func Critf(msg string, args ...interface{})
Logs a formatted Crit message. Supports fmt.Sprintf style arguments.
func Debugf ¶
func Debugf(msg string, args ...interface{})
Logs a formatted Debug message. Supports fmt.Sprintf style arguments.
func Emergf ¶
func Emergf(msg string, args ...interface{})
Logs a formatted Emerg message. Supports fmt.Sprintf style arguments.
func Errorf ¶
func Errorf(msg string, args ...interface{})
Logs a formatted Error message. Supports fmt.Sprintf style arguments.
func Infof ¶
func Infof(msg string, args ...interface{})
Logs a formatted Info message. Supports fmt.Sprintf style arguments.
func Noticef ¶
func Noticef(msg string, args ...interface{})
Logs a formatted Notice message. Supports fmt.Sprintf style arguments.
func SetupLogging ¶
func SetupLogging(cfg LogConfig)