Merge branch 'master' of github.com:d4l3k/gorm

This commit is contained in:
Tristan Rice 2016-01-29 15:02:16 -08:00
commit 34a3fd2a3a

View File

@ -4,6 +4,7 @@ import (
"database/sql/driver" "database/sql/driver"
"errors" "errors"
"fmt" "fmt"
"log"
"regexp" "regexp"
"strings" "strings"
"time" "time"
@ -361,6 +362,8 @@ func (scope *Scope) InstanceGet(name string) (interface{}, bool) {
// Trace print sql log // Trace print sql log
func (scope *Scope) Trace(t time.Time) { func (scope *Scope) Trace(t time.Time) {
if len(scope.Sql) > 0 { if len(scope.Sql) > 0 {
// TODO(d4l3k): Remove this line
log.Println("sql", scope.Sql, scope.SqlVars)
scope.db.slog(scope.Sql, t, scope.SqlVars...) scope.db.slog(scope.Sql, t, scope.SqlVars...)
} }
} }