details: https://code.tryton.org/tryton/commit/60a4baa7c9ca
branch: default
user: Cédric Krier <[email protected]>
date: Wed Aug 27 10:00:14 2025 +0200
description:
Decode the SQL query logged by the Postgresql backend
This makes it easier to copy and paste the query when debugging.
diffstat:
trytond/trytond/backend/postgresql/database.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diffs (12 lines):
diff -r c1bb5150cfaf -r 60a4baa7c9ca
trytond/trytond/backend/postgresql/database.py
--- a/trytond/trytond/backend/postgresql/database.py Mon Aug 25 13:37:31
2025 +0200
+++ b/trytond/trytond/backend/postgresql/database.py Wed Aug 27 10:00:14
2025 +0200
@@ -70,7 +70,7 @@
class LoggingCursor(cursor):
def execute(self, sql, args=None):
if logger.isEnabledFor(logging.DEBUG):
- logger.debug(self.mogrify(sql, args))
+ logger.debug('query: %s', self.mogrify(sql, args).decode())
cursor.execute(self, sql, args)