ShowSQL bug fixed

This commit is contained in:
Lunny Xiao 2014-05-31 12:22:06 +08:00
parent bd1487ba55
commit 23d0d656da
1 changed files with 2 additions and 2 deletions

View File

@ -175,9 +175,9 @@ func (engine *Engine) Ping() error {
func (engine *Engine) logSQL(sqlStr string, sqlArgs ...interface{}) { func (engine *Engine) logSQL(sqlStr string, sqlArgs ...interface{}) {
if engine.ShowSQL { if engine.ShowSQL {
if len(sqlArgs) > 0 { if len(sqlArgs) > 0 {
engine.LogInfo("[sql]", sqlStr, "[args]", sqlArgs) engine.Logger.Info(fmt.Sprintln("[sql]", sqlStr, "[args]", sqlArgs))
} else { } else {
engine.LogInfo("[sql]", sqlStr) engine.Logger.Info(fmt.Sprintln("[sql]", sqlStr))
} }
} }
} }