go_goutils/logging/types.go

35 lines
587 B
Go

package logging
import (
"log"
"os"
)
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)
GetPrefix() string
Setup()
Shutdown()
}
type StdLogger struct {
*log.Logger
EnableDebug bool
Prefix string
}
type FileLogger struct {
StdLogger
Path string
writer *os.File
}