This commit is contained in:
2021-02-26 15:52:29 -05:00
parent 8dea2185fd
commit d085d0f3ee
10 changed files with 407 additions and 0 deletions

44
logging/types.go Normal file
View File

@@ -0,0 +1,44 @@
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
}