Skip to content
Snippets Groups Projects
Commit 10e7af09 authored by Ian's avatar Ian
Browse files

fix: finetuned logging levels for file vs console logging

parent 2e9b27df
No related branches found
No related tags found
No related merge requests found
......@@ -154,11 +154,13 @@ def main(
# Set up logging with both file and console handlers
logger = logging.getLogger()
logger.setLevel(logging.INFO)
logger.setLevel(logging.DEBUG)
# File handler with timestamps
file_handler = logging.FileHandler(filename=output_dir / "run.log",
mode="w")
file_handler.setLevel(logging.DEBUG)
file_handler.setFormatter(
logging.Formatter("%(asctime)s - %(message)s",
datefmt="%Y-%m-%d %H:%M:%S")
......@@ -167,6 +169,7 @@ def main(
# Console handler without timestamps
console_handler = logging.StreamHandler()
console_handler.setFormatter(logging.Formatter("%(message)s"))
console_handler.setLevel(logging.INFO)
# Add both handlers
logger.addHandler(file_handler)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment