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 Alert(msg string, args ...interface{})
- func Crit(msg string, args ...interface{})
- func Debug(msg string, args ...interface{})
- func Emerg(msg string, args ...interface{})
- func Error(msg string, args ...interface{})
- func Info(msg string, args ...interface{})
- func Notice(msg string, args ...interface{})
- func SetupLogging(cfg LogConfig)
- func Warn(msg string, args ...interface{})
- type LogConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Alert ¶
func Alert(msg string, args ...interface{})
Logs an Alert message. Supports fmt.Sprintf style arguments.
func Crit ¶
func Crit(msg string, args ...interface{})
Logs a Crit message. Supports fmt.Sprintf style arguments.
func Debug ¶
func Debug(msg string, args ...interface{})
Logs a Debug message. Supports fmt.Sprintf style arguments.
func Emerg ¶
func Emerg(msg string, args ...interface{})
Logs an Emerg message. Supports fmt.Sprintf style arguments.
func Error ¶
func Error(msg string, args ...interface{})
Logs an Error message. Supports fmt.Sprintf style arguments.
func Info ¶
func Info(msg string, args ...interface{})
Logs an Info message. Supports fmt.Sprintf style arguments.
func Notice ¶
func Notice(msg string, args ...interface{})
Logs a Notice message. Supports fmt.Sprintf style arguments.
func SetupLogging ¶
func SetupLogging(cfg LogConfig)
Does the needful to set up the logging subsystem based on the passed configuration data.