45 lines
743 B
Go
45 lines
743 B
Go
|
package logging
|
||
|
|
||
|
import (
|
||
|
`log`
|
||
|
`log/syslog`
|
||
|
)
|
||
|
|
||
|
type Logger interface {
|
||
|
Alert(string, ...interface{}) error
|
||
|
Crit(string, ...interface{}) error
|
||
|
Debug(string, ...interface{}) error
|
||
|
Emerg(string, ...interface{}) error
|
||
|
Err(string, ...interface{}) error
|
||
|
Info(string, ...interface{}) error
|
||
|
Notice(string, ...interface{}) error
|
||
|
Warning(string, ...interface{}) error
|
||
|
doDebug(bool)
|
||
|
setPrefix(string)
|
||
|
}
|
||
|
|
||
|
type SystemDLogger struct {
|
||
|
EnableDebug bool
|
||
|
Prefix string
|
||
|
}
|
||
|
|
||
|
type SyslogLogger struct {
|
||
|
syslog.Writer
|
||
|
EnableDebug bool
|
||
|
Prefix string
|
||
|
}
|
||
|
|
||
|
type StdLogger struct {
|
||
|
log.Logger
|
||
|
EnableDebug bool
|
||
|
Prefix string
|
||
|
}
|
||
|
|
||
|
type FileLogger struct {
|
||
|
log.Logger
|
||
|
StdLogger
|
||
|
EnableDebug bool
|
||
|
Path string
|
||
|
Prefix string
|
||
|
}
|