mirror of
https://github.com/jackc/pgx.git
synced 2025-05-31 11:42:24 +00:00
Merge pull request #761 from ikozinov/rows-close-logger
Added err field because log output is a bit confusing since it is not clear what error occurred
This commit is contained in:
commit
e6c101413b
2
rows.go
2
rows.go
@ -146,7 +146,7 @@ func (rows *connRows) Close() {
|
||||
rows.logger.log(rows.ctx, LogLevelInfo, "Query", map[string]interface{}{"sql": rows.sql, "args": logQueryArgs(rows.args), "time": endTime.Sub(rows.startTime), "rowCount": rows.rowCount})
|
||||
}
|
||||
} else if rows.logger.shouldLog(LogLevelError) {
|
||||
rows.logger.log(rows.ctx, LogLevelError, "Query", map[string]interface{}{"sql": rows.sql, "args": logQueryArgs(rows.args)})
|
||||
rows.logger.log(rows.ctx, LogLevelError, "Query", map[string]interface{}{"err": rows.err, "sql": rows.sql, "args": logQueryArgs(rows.args)})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user