From 0e701020bbacccfa35c69c52de879eb9f7bfb793 Mon Sep 17 00:00:00 2001 From: Untone Date: Tue, 20 Feb 2024 17:27:30 +0300 Subject: [PATCH] lesslog --- services/db.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/db.py b/services/db.py index 75da0f53..f6ae551e 100644 --- a/services/db.py +++ b/services/db.py @@ -40,7 +40,8 @@ def before_cursor_execute(conn, cursor, statement, parameters, context, executem def after_cursor_execute(conn, cursor, statement, parameters, context, executemany): total = time.time() - conn.info['query_start_time'].pop(-1) stars = '*' * math.floor(total*1000) - logger.debug(f' {stars} {total*1000} s\n') + if stars: + logger.debug(f' {stars} {total*1000} s\n') def local_session(src=''): return Session(bind=engine, expire_on_commit=False)