1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-01 09:30:18 +00:00

orm add queries debug logger

This commit is contained in:
slene
2013-08-09 13:20:19 +08:00
parent 8563000235
commit 45aa071261
8 changed files with 216 additions and 26 deletions

View File

@ -26,7 +26,7 @@ func getResult(res sql.Result) (int64, error) {
type rawPrepare struct {
rs *rawSet
stmt *sql.Stmt
stmt stmtQuerier
closed bool
}
@ -53,7 +53,11 @@ func newRawPreparer(rs *rawSet) (RawPreparer, error) {
if err != nil {
return nil, err
}
o.stmt = st
if Debug {
o.stmt = newStmtQueryLog(rs.orm.alias, st, rs.query)
} else {
o.stmt = st
}
return o, nil
}