From e4e681a9abad3ce4b4e42f0ca06b98b97ff16d4b Mon Sep 17 00:00:00 2001 From: Untone Date: Wed, 6 Mar 2024 22:18:32 +0300 Subject: [PATCH] logs-with-params --- schema/query.graphql | 2 +- services/db.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/schema/query.graphql b/schema/query.graphql index 0d90e946..588c6b3e 100644 --- a/schema/query.graphql +++ b/schema/query.graphql @@ -32,7 +32,7 @@ type Query { load_shouts_random_topic(limit: Int!): CommonResult! # { topic shouts } # editor - get_my_shout(shout_id: Int!): CommonResult + get_my_shout(shout_id: Int!): CommonResult! get_shouts_drafts: [Shout] # topic diff --git a/services/db.py b/services/db.py index 4c964371..085ab80f 100644 --- a/services/db.py +++ b/services/db.py @@ -100,6 +100,6 @@ def after_cursor_execute(conn, cursor, statement, parameters, context, executema if hasattr(conn, 'query_start_time'): elapsed = time.time() - conn.query_start_time conn.query_start_time = None - query = f'{statement}'.replace('\n', ' ') + query = f'{statement} % {parameters}' if parameters else f'{statement}'.replace('\n', ' ') if elapsed > 1: logger.debug(f"\n{query}\n{'*' * math.floor(elapsed)} {elapsed:.3f} s\n")