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