From 756b95abc8f3b3c1c2a08f4a8cbc81f0d0d39527 Mon Sep 17 00:00:00 2001 From: Peery Date: Mon, 14 Feb 2022 00:25:37 +0100 Subject: [PATCH] Changed printing logs for logging purposes Changed some logs to better suit being logged instead of just debugging purposes. --- ArtNet/artnet_manager.py | 4 ++-- ArtNet/db/db_adapter.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ArtNet/artnet_manager.py b/ArtNet/artnet_manager.py index 6dd1d9f..f5f0b41 100644 --- a/ArtNet/artnet_manager.py +++ b/ArtNet/artnet_manager.py @@ -353,7 +353,7 @@ class ArtNetManager: image_link = "(Unknown)" image_description = None - print("Displaying", self.all_images[self.curr_image_index]) + print(f"Displaying #{self.curr_image_index} \"{self.all_images[self.curr_image_index]}\"") self.window.display_image(image_title, image_author, os.path.join(self.config.data["file_root"], self.all_images[self.curr_image_index]), self.all_images[self.curr_image_index], @@ -364,7 +364,7 @@ class ArtNetManager: self.window.setting_up_data = False def create_db_connection(self, host: str, port: int, database: str, user: str, password: str) -> DBAdapter: - print(f"Changing db connection to {host}:{port} {user}@{database}") + print(f"Changing db connection to {host}:{port} {user}@{database} ...") return DBAdapter(user=user, password=password, host=host, port=port, database=database) def get_root(self) -> str: diff --git a/ArtNet/db/db_adapter.py b/ArtNet/db/db_adapter.py index f42a58b..b430bab 100644 --- a/ArtNet/db/db_adapter.py +++ b/ArtNet/db/db_adapter.py @@ -17,10 +17,10 @@ class DBAdapter: except psycopg2.OperationalError as e: raise ValueError("Invalid DB credentials!") - print("DB connection to {0}:{1}/{2}".format(host, port, database)) + print("DB connection established to {0}:{1}/{2}".format(host, port, database)) if not self.check_tables(): - raise ValueError("Invalid DB schema") + raise ValueError("Invalid DB schema!") def check_tables(self) -> bool: """