You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FOCA 0.22.0 deprecates several APIs ahead of the ASGI release:
app.config.foca (reading, setting, deleting) and get_app_config();
Unauthorized(www_authenticate=...) and Unauthorized.www_authenticate;
x-body-name: permission for the permissions API.
Each of these emits a DeprecationWarning. Python hides DeprecationWarning outside __main__ by default, so operators running apps under Gunicorn never see them. As decided by the maintainer, FOCA should also log each deprecation once per process at WARNING level.
Do:
One shared helper emits the DeprecationWarning, with the caller's stack level, as before. The first time a deprecation fires in a process, it also logs the message at WARNING on a FOCA logger. The log is keyed per deprecation, is thread-safe and never fails the call. FOCA's deprecations use it.
Docs: say in docs/migration-0.22.md and the logging configuration docs (docs/configuration/log.md) that deprecations are logged once per process, name the logger, and say how to silence it.
Tests: a deprecation logs once per process, and the warning is still emitted on every call. The existing deprecation tests stay green.
Out of scope: the warning that FOCA already logs, once per class, for exception maps with raw Werkzeug classes.
Activity
fix: log a deprecation again if logging failed