diff options
| author | Frederick Muriuki Muriithi | 2026-04-13 13:53:04 -0500 |
|---|---|---|
| committer | Frederick Muriuki Muriithi | 2026-04-13 13:55:09 -0500 |
| commit | 8f8d678497921ba6d45e41547841a49bc1ff458b (patch) | |
| tree | cd720dc59079712c7f0a38963b7913ad290f8a5c | |
| parent | 2488f246fcc9c22db87eba4d0a4a03f189a04f46 (diff) | |
| download | gn-uploader-8f8d678497921ba6d45e41547841a49bc1ff458b.tar.gz | |
Add module-level logging.
| -rw-r--r-- | uploader/request_checks.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/uploader/request_checks.py b/uploader/request_checks.py index f1d8027..93bc902 100644 --- a/uploader/request_checks.py +++ b/uploader/request_checks.py @@ -2,6 +2,8 @@ These are useful for reusability, and hence maintainability of the code. """ +import logging + from functools import wraps from gn_libs.mysqldb import database_connection @@ -10,6 +12,9 @@ from flask import flash, url_for, redirect, current_app as app from uploader.species.models import species_by_id from uploader.population.models import population_by_species_and_id +logger = logging.getLogger(__name__) + + def with_species(redirect_uri: str): """Ensure the species actually exists.""" def __decorator__(function): @@ -28,7 +33,7 @@ def with_species(redirect_uri: str): "alert-danger") return redirect(url_for(redirect_uri)) except ValueError as _verr: - app.logger.debug( + logger.debug( "Exception converting value to integer: %s", kwargs.get("species_id"), exc_info=True) @@ -63,7 +68,7 @@ def with_population(species_redirect_uri: str, redirect_uri: str): "alert-danger") return select_population_uri except ValueError as _verr: - app.logger.debug( + logger.debug( "Exception converting value to integer: %s", kwargs.get("population_id"), exc_info=True) |
