Browse Source

improved SQL log

xormplus 8 years ago
parent
commit
11225e9864
1 changed files with 2 additions and 2 deletions
  1. 2 2
      dialect.go

+ 2 - 2
dialect.go

@@ -279,9 +279,9 @@ func (b *Base) ForUpdateSql(query string) string {
 func (b *Base) LogSQL(sql string, args []interface{}) {
 func (b *Base) LogSQL(sql string, args []interface{}) {
 	if b.logger != nil && b.logger.IsShowSQL() {
 	if b.logger != nil && b.logger.IsShowSQL() {
 		if len(args) > 0 {
 		if len(args) > 0 {
-			b.logger.Info("[sql]", sql, args)
+			b.logger.Infof("[SQL] %v %v", sql, args)
 		} else {
 		} else {
-			b.logger.Info("[sql]", sql)
+			b.logger.Infof("[SQL] %v", sql)
 		}
 		}
 	}
 	}
 }
 }