style(database): Fixed type of logger on the db sucsess operations

This commit is contained in:
Kita Trofimov
2025-10-26 20:31:51 +03:00
parent 401205aea2
commit c33e8798ed
6 changed files with 45 additions and 45 deletions
+3 -3
View File
@@ -24,7 +24,7 @@ def get_connection() -> Generator[psycopg2.extensions.connection, None, None]:
conn = None
try:
conn = PSQLConnect()
logger.info("Подключение к БД установлено")
logger.debug("Подключение к БД установлено")
yield conn
except psycopg2.OperationalError as e:
logger.error(f"Ошибка подключения к БД: {e}")
@@ -39,7 +39,7 @@ def get_connection() -> Generator[psycopg2.extensions.connection, None, None]:
if conn:
try:
conn.close()
logger.info("Соединение с БД закрыто")
logger.debug("Соединение с БД закрыто")
except Exception as e:
logger.warning(f"Ошибка при закрытии соединения: {e}")
@@ -50,7 +50,7 @@ def test_connection() -> bool:
try:
cur.execute("SELECT version();")
version = cur.fetchone()
logger.info(f"Версия PostgreSQL: {version[0]}")
logger.debug(f"Версия PostgreSQL: {version[0]}")
return True
finally:
cur.close()