Merge pull request #645 from hobeone/master

Change logger to use an interface.
This commit is contained in:
Jinzhu 2015-09-03 07:43:35 +08:00
commit 447885d98f
1 changed files with 5 additions and 1 deletions

View File

@ -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)}