go_goutils/logging/types.go

35 lines
587 B
Go
Raw Normal View History

2021-02-26 15:52:29 -05:00
package logging
import (
2021-02-27 00:51:58 -05:00
"log"
"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-27 00:51:58 -05:00
GetPrefix() string
2021-02-26 20:27:35 -05:00
Setup()
Shutdown()
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
}