mirror of
https://github.com/HDT3213/godis.git
synced 2025-11-03 11:02:17 +08:00
converted DefaultLogger type to interface
This commit is contained in:
@@ -46,6 +46,11 @@ var (
|
||||
levelFlags = []string{"DEBUG", "INFO", "WARN", "ERROR", "FATAL"}
|
||||
)
|
||||
|
||||
// ILogger defines the methods that any logger should implement
|
||||
type ILogger interface {
|
||||
Output(level logLevel, callerDepth int, msg string)
|
||||
}
|
||||
|
||||
// Logger is Logger
|
||||
type Logger struct {
|
||||
logFile *os.File
|
||||
@@ -54,7 +59,7 @@ type Logger struct {
|
||||
entryPool *sync.Pool
|
||||
}
|
||||
|
||||
var DefaultLogger = NewStdoutLogger()
|
||||
var DefaultLogger ILogger = NewStdoutLogger()
|
||||
|
||||
// NewStdoutLogger creates a logger which print msg to stdout
|
||||
func NewStdoutLogger() *Logger {
|
||||
|
||||
Reference in New Issue
Block a user