playing with logging

This commit is contained in:
2025-10-31 20:19:10 -04:00
parent e89fb9fae1
commit a7c0a58c9a
6 changed files with 80 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
import logging
import sys
def configure_logger(level: str = "INFO", test: str = None) -> None:
"""Configure the logger.
Args:
level (str, optional): The logging level. Defaults to "INFO".
"""
logging.basicConfig(
level=level,
datefmt="%Y-%m-%dT%H:%M:%S%z",
format="%(asctime)s %(levelname)s %(filename)s:%(lineno)d - %(message)s"
f" {test}",
handlers=[logging.StreamHandler(sys.stdout)],
)