mirror of https://github.com/go-gorm/gorm.git
Change logger to use an interface. This allows reuse of the nice formatting
done by gorm while still sending the output to a custom logger.
This commit is contained in:
parent
d3fea6c535
commit
fac5e822ff
|
@ -14,8 +14,12 @@ type logger interface {
|
||||||
Print(v ...interface{})
|
Print(v ...interface{})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type LogWriter interface {
|
||||||
|
Println(v ...interface{})
|
||||||
|
}
|
||||||
|
|
||||||
type Logger struct {
|
type Logger struct {
|
||||||
*log.Logger
|
LogWriter
|
||||||
}
|
}
|
||||||
|
|
||||||
var defaultLogger = Logger{log.New(os.Stdout, "\r\n", 0)}
|
var defaultLogger = Logger{log.New(os.Stdout, "\r\n", 0)}
|
||||||
|
|
Loading…
Reference in New Issue