diff options
| author | Pinapelz <yukais@pinapelz.com> | 2024-10-04 11:16:17 -0700 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2024-10-04 11:16:17 -0700 |
| commit | afbeb5ff8655a192192c9607ee1ae6ed7be78b0c (patch) | |
| tree | 0a8cc37e97a0d6558d79362aaae1ad06551d65f1 /sql/pg_handler.py | |
| parent | b9fe59a2bb8c50c09224991ca3a29ce754e80cda (diff) | |
improve output logging
- logs to file
Diffstat (limited to 'sql/pg_handler.py')
| -rw-r--r-- | sql/pg_handler.py | 5 |
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): |
