From 0f43bb941875daef07edc18a4dd940bd57f7f16b Mon Sep 17 00:00:00 2001 From: Caleb Ely Date: Sat, 8 Jun 2024 16:10:37 -0400 Subject: [PATCH] Always enable the linkrot text file logger --- CHANGES.md | 1 + src/app_factory.py | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index f945016..865f323 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -9,6 +9,7 @@ _Released TDB_ - Add readme sections to explain new filtering and embed features - Ensure the `date_added` field is expressed in UTC - Fix error when linkrot checking with an ID that does not exist in the webring +- Always enable the linkrot text file logger - Replace `requests` with `python-httpx` - Update OpenAPI spec version - Update minimum Python version to 3.11 diff --git a/src/app_factory.py b/src/app_factory.py index 5447691..e43dcdc 100644 --- a/src/app_factory.py +++ b/src/app_factory.py @@ -24,11 +24,10 @@ def create_app() -> Flask: if sys_vars.get("FLASK_ENV") == "production": app.config["OPENAPI_URL_PREFIX"] = None - # Enable Discord webhook event logging, falling back to a text log + # Set up a file logger, additionally enabling the Discord webhook event logging if requested + logger.logger.addHandler(logger.file_handler("error-linkrot.log", linkrot=True)) if sys_vars.get_bool("ENABLE_DISCORD_LOGGING"): logger.logger.addHandler(logger.DiscordHandler()) - else: - logger.logger.addHandler(logger.file_handler("error-linkrot.log", linkrot=True)) # Register the API endpoints api = Api(app)