summaryrefslogtreecommitdiffstats
path: root/sql
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2024-10-04 11:16:17 -0700
committerPinapelz <yukais@pinapelz.com>2024-10-04 11:16:17 -0700
commitafbeb5ff8655a192192c9607ee1ae6ed7be78b0c (patch)
tree0a8cc37e97a0d6558d79362aaae1ad06551d65f1 /sql
parentb9fe59a2bb8c50c09224991ca3a29ce754e80cda (diff)
improve output logging
- logs to file
Diffstat (limited to 'sql')
-rw-r--r--sql/pg_handler.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/pg_handler.py b/sql/pg_handler.py
index 74a9170..b528a26 100644
--- a/sql/pg_handler.py
+++ b/sql/pg_handler.py
@@ -11,7 +11,7 @@ class PostgresHandler:
"port": port
}
self._connection = psycopg2.connect(**db_params)
- print("Handler Success")
+ self.print_to_debug("Connected to database successfully")
def get_connection(self):
return self._connection
@@ -163,6 +163,9 @@ class PostgresHandler:
print(f"Failed to get most recently added row from {table_name}")
print(e)
return False
+
+ def print_to_debug(self, message: str):
+ print("[PostgresHandler] " + message)
def close_connection(self):
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage