diff options
| author | Frederick Muriuki Muriithi | 2026-04-13 14:33:39 -0500 |
|---|---|---|
| committer | Frederick Muriuki Muriithi | 2026-04-13 14:33:39 -0500 |
| commit | af62ff14574d708a138b011a7089e085c4ad183c (patch) | |
| tree | 04a6de162fd610bddbe5fe8f0d8c6d13003ff88b | |
| parent | d71a40a518f1dd7ed8ef29affa314962d63e88b2 (diff) | |
| download | gn-uploader-af62ff14574d708a138b011a7089e085c4ad183c.tar.gz | |
Pick loggable modules from the application configurations.
To avoid having to modify code just to activate logging in a specific module, this commit makes the list of loggable modules into a configuration variable that can be loaded at startup.
| -rw-r--r-- | uploader/__init__.py | 9 | ||||
| -rw-r--r-- | uploader/default_settings.py | 3 |
2 files changed, 5 insertions, 7 deletions
diff --git a/uploader/__init__.py b/uploader/__init__.py index e00c726..afaa78d 100644 --- a/uploader/__init__.py +++ b/uploader/__init__.py @@ -131,13 +131,8 @@ def create_app(config: Optional[dict] = None): default_timeout=int(app.config["SESSION_FILESYSTEM_CACHE_TIMEOUT"])) setup_logging(app) - setup_modules_logging(app.logger, ( - "uploader.base_routes", - "uploader.flask_extensions", - "uploader.publications.models", - "uploader.publications.datatables", - "uploader.phenotypes.models", - "uploader.phenotypes.views")) + setup_modules_logging( + app.logger, tuple(app.config.get("LOGGABLE_MODULES", []))) # setup jinja2 symbols app.add_template_global(user_logged_in) diff --git a/uploader/default_settings.py b/uploader/default_settings.py index 6381a67..04e1c0a 100644 --- a/uploader/default_settings.py +++ b/uploader/default_settings.py @@ -39,3 +39,6 @@ JWKS_DELETION_AGE_DAYS = 14 # Days (from creation) to keep a JWK around before d ## --- Feature flags --- FEATURE_FLAGS_HTTP: list[str] = [] + +## --- Modules for which to log output --- +LOGGABLE_MODULES: list[str] = [] |
