Skip to content

Commit

Permalink
ENH: Change prints to logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Ng committed Jan 24, 2025
1 parent 1b97572 commit 705c8c1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/src/model/options_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"""

import json
import logging
import os


Expand All @@ -23,7 +24,7 @@ def get_options_from_file(self, filepath: str = "./app/src/options.json") -> Non
os.makedirs(os.path.dirname(filepath), exist_ok=True)
with open(filepath, "w") as json_file:
json.dump({}, json_file)
print(f"Created a new options file at: {filepath}")
logging.info(f"Created a new options file at: {filepath}")

# Read the file
with open(filepath, "r") as json_file:
Expand All @@ -33,7 +34,7 @@ def get_options_from_file(self, filepath: str = "./app/src/options.json") -> Non
if output_folder is not None and os.path.exists(output_folder):
self.output_folder = output_folder
except json.JSONDecodeError:
print(f"Invalid JSON in file: {filepath}.")
logging.error(f"Invalid JSON in file: {filepath}.")

def write_options_to_file(self, filepath: str = "./app/src/options.json") -> None:
"""Writes GUI options to file.
Expand Down

0 comments on commit 705c8c1

Please sign in to comment.