2021-02-26 15:52:29 -05:00
|
|
|
package logging
|
|
|
|
|
|
|
|
import (
|
2021-02-26 20:27:35 -05:00
|
|
|
`log/syslog`
|
2021-02-26 15:52:29 -05:00
|
|
|
`os`
|
|
|
|
|
|
|
|
`r00t2.io/goutils/types`
|
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
|
|
devlog string = "/dev/log"
|
|
|
|
logPerm os.FileMode = 0600
|
2021-02-26 20:27:35 -05:00
|
|
|
logPrefix string = "GOLANG PROGRAM"
|
|
|
|
appendFlags int = os.O_APPEND|os.O_CREATE|os.O_WRONLY
|
|
|
|
syslogFacility syslog.Priority = syslog.LOG_USER
|
2021-02-26 15:52:29 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
// Flags for logger configuration
|
|
|
|
const (
|
|
|
|
LogUndefined types.MaskBit = 1 << iota
|
|
|
|
LogJournald
|
|
|
|
LogSyslog
|
|
|
|
LogFile
|
|
|
|
LogStdout
|
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
defLogPaths = []string{"/var/log/golang/program.log", "~/.local/log/golang/program.log"}
|
|
|
|
)
|