go_goutils/logging/types.go

53 lines
795 B
Go
Raw Normal View History

2021-02-26 15:52:29 -05:00
package logging
import (
`log`
`log/syslog`
2021-02-26 20:27:35 -05:00
`os`
2021-02-26 15:52:29 -05:00
)
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)
2021-02-26 20:27:35 -05:00
Setup()
Shutdown()
2021-02-26 15:52:29 -05:00
}
type SystemDLogger struct {
EnableDebug bool
Prefix string
}
type SyslogLogger struct {
EnableDebug bool
Prefix string
2021-02-26 20:27:35 -05:00
alert,
crit,
debug,
emerg,
err,
info,
notice,
warning *syslog.Writer
2021-02-26 15:52:29 -05:00
}
type StdLogger struct {
2021-02-26 20:27:35 -05:00
*log.Logger
2021-02-26 15:52:29 -05:00
EnableDebug bool
Prefix string
}
type FileLogger struct {
StdLogger
2021-02-26 20:27:35 -05:00
Path string
writer *os.File
2021-02-26 15:52:29 -05:00
}