logs-with-params

This commit is contained in:
Untone 2024-03-06 22:18:32 +03:00
parent 5c7b28de90
commit e4e681a9ab
2 changed files with 2 additions and 2 deletions

View File

@ -32,7 +32,7 @@ type Query {
load_shouts_random_topic(limit: Int!): CommonResult! # { topic shouts } load_shouts_random_topic(limit: Int!): CommonResult! # { topic shouts }
# editor # editor
get_my_shout(shout_id: Int!): CommonResult get_my_shout(shout_id: Int!): CommonResult!
get_shouts_drafts: [Shout] get_shouts_drafts: [Shout]
# topic # topic

View File

@ -100,6 +100,6 @@ def after_cursor_execute(conn, cursor, statement, parameters, context, executema
if hasattr(conn, 'query_start_time'): if hasattr(conn, 'query_start_time'):
elapsed = time.time() - conn.query_start_time elapsed = time.time() - conn.query_start_time
conn.query_start_time = None conn.query_start_time = None
query = f'{statement}'.replace('\n', ' ') query = f'{statement} % {parameters}' if parameters else f'{statement}'.replace('\n', ' ')
if elapsed > 1: if elapsed > 1:
logger.debug(f"\n{query}\n{'*' * math.floor(elapsed)} {elapsed:.3f} s\n") logger.debug(f"\n{query}\n{'*' * math.floor(elapsed)} {elapsed:.3f} s\n")