Skip to content

Commit

Permalink
Minor changes in application/__init__.py according to coderabbitai's …
Browse files Browse the repository at this point in the history
…feedback
  • Loading branch information
li-ruihao committed Dec 27, 2024
1 parent 2d6129e commit 74e7f21
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions application/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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

Expand Down

0 comments on commit 74e7f21

Please sign in to comment.