From fac5e822ff80a793be6298b50c037694eba3b878 Mon Sep 17 00:00:00 2001 From: Daniel Hobe Date: Wed, 2 Sep 2015 09:37:44 -0700 Subject: [PATCH] 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. --- logger.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/logger.go b/logger.go index 907faa8e..fcd0b57c 100644 --- a/logger.go +++ b/logger.go @@ -14,8 +14,12 @@ type logger interface { Print(v ...interface{}) } +type LogWriter interface { + Println(v ...interface{}) +} + type Logger struct { - *log.Logger + LogWriter } var defaultLogger = Logger{log.New(os.Stdout, "\r\n", 0)}