More logging
This commit is contained in:
@@ -571,7 +571,7 @@ func (c *Conn) Exec(sql string, arguments ...interface{}) (commandTag CommandTag
|
|||||||
defer func() {
|
defer func() {
|
||||||
if err == nil {
|
if err == nil {
|
||||||
endTime := time.Now()
|
endTime := time.Now()
|
||||||
c.logger.Info("Exec", "sql", sql, "args", arguments, "time", endTime.Sub(startTime))
|
c.logger.Info("Exec", "sql", sql, "args", arguments, "time", endTime.Sub(startTime), "commandTag", commandTag)
|
||||||
} else {
|
} else {
|
||||||
c.logger.Error("Exec", "sql", sql, "args", arguments, "error", err)
|
c.logger.Error("Exec", "sql", sql, "args", arguments, "error", err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ func (rows *Rows) close() {
|
|||||||
|
|
||||||
if rows.err == nil {
|
if rows.err == nil {
|
||||||
endTime := time.Now()
|
endTime := time.Now()
|
||||||
rows.logger.Info("Query", "sql", rows.sql, "args", rows.args, "time", endTime.Sub(rows.startTime))
|
rows.logger.Info("Query", "sql", rows.sql, "args", rows.args, "time", endTime.Sub(rows.startTime), "rowCount", rows.rowCount)
|
||||||
} else {
|
} else {
|
||||||
rows.logger.Error("Query", "sql", rows.sql, "args", rows.args)
|
rows.logger.Error("Query", "sql", rows.sql, "args", rows.args)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user