Changed printing logs for logging purposes

Changed some logs to better suit being logged instead of just debugging purposes.
dev
Peery 3 years ago
parent 95498c061d
commit 756b95abc8

@ -353,7 +353,7 @@ class ArtNetManager:
image_link = "(Unknown)" image_link = "(Unknown)"
image_description = None 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, self.window.display_image(image_title, image_author,
os.path.join(self.config.data["file_root"], self.all_images[self.curr_image_index]), os.path.join(self.config.data["file_root"], self.all_images[self.curr_image_index]),
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 self.window.setting_up_data = False
def create_db_connection(self, host: str, port: int, database: str, user: str, password: str) -> DBAdapter: 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) return DBAdapter(user=user, password=password, host=host, port=port, database=database)
def get_root(self) -> str: def get_root(self) -> str:

@ -17,10 +17,10 @@ class DBAdapter:
except psycopg2.OperationalError as e: except psycopg2.OperationalError as e:
raise ValueError("Invalid DB credentials!") 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(): if not self.check_tables():
raise ValueError("Invalid DB schema") raise ValueError("Invalid DB schema!")
def check_tables(self) -> bool: def check_tables(self) -> bool:
""" """

Loading…
Cancel
Save