From 74e7f2124b79dcc8c1ba6a88ba6aff951f74a630 Mon Sep 17 00:00:00 2001 From: Ruihao Li Date: Thu, 26 Dec 2024 19:49:40 -0500 Subject: [PATCH] Minor changes in application/__init__.py according to coderabbitai's feedback --- application/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/application/__init__.py b/application/__init__.py index f1fbf88..1352c9e 100644 --- a/application/__init__.py +++ b/application/__init__.py @@ -29,10 +29,10 @@ logger = logging.getLogger(__name__) try: - with open('log_config.yaml', 'r') as config_file: + with open('log_config.yaml') as config_file: config = yaml.safe_load(config_file.read()) logging.config.dictConfig(config) -except: +except Exception: # Fallback to a basic configuration logging.basicConfig(format='%(asctime)s - %(levelname)s - %(message)s') logger.exception("Logging setup failed") @@ -41,7 +41,7 @@ # As well, to ensure that logging configuration succeeded regardless # of a successful dictConfig execution, log a warning message # to see whether the configuration was actually successful - logger.warning(f"Logging is set up with config={config}") + logger.warning("Logging is set up with config=%s", config) from .Profile.Profile import Profile