2021-12-15 04:49:03 -05:00
|
|
|
package logging
|
|
|
|
|
|
|
|
import (
|
|
|
|
`log/syslog`
|
|
|
|
)
|
|
|
|
|
2022-01-16 06:55:29 -05:00
|
|
|
/*
|
|
|
|
SystemDLogger (yes, I'm aware it's actually written as "systemd") writes to journald on systemd-enabled systems.
|
|
|
|
*/
|
2021-12-15 04:49:03 -05:00
|
|
|
type SystemDLogger struct {
|
|
|
|
EnableDebug bool
|
|
|
|
Prefix string
|
|
|
|
}
|
|
|
|
|
2022-01-16 06:55:29 -05:00
|
|
|
// SyslogLogger writes to syslog on syslog-enabled systems.
|
2021-12-15 04:49:03 -05:00
|
|
|
type SyslogLogger struct {
|
|
|
|
EnableDebug bool
|
|
|
|
Prefix string
|
|
|
|
alert,
|
|
|
|
crit,
|
|
|
|
debug,
|
|
|
|
emerg,
|
|
|
|
err,
|
|
|
|
info,
|
|
|
|
notice,
|
|
|
|
warning *syslog.Writer
|
|
|
|
}
|