From 76ba440551ff1ff4f9f3a742e61773eda7b63f03 Mon Sep 17 00:00:00 2001 From: Matthias Tafelmeier Date: Wed, 15 Nov 2023 13:00:22 +0100 Subject: [PATCH] api - log operational error --- api/archive_db.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/archive_db.py b/api/archive_db.py index f3b5044c..41d05f40 100644 --- a/api/archive_db.py +++ b/api/archive_db.py @@ -1,5 +1,6 @@ import psycopg2 +import logging class archive_db(): @@ -16,7 +17,7 @@ def execute(db_info=None, query=""): db_cursor.execute(query) except psycopg2.OperationalError as Error: - print(f"Error connecting to the database : {Error}") + logging.error(f"Error connecting to the database : {Error}") finally: if db_connection: