Pass the request ctx rather than use the globals in the app

The globals have a performance penalty which can be justified for the
convinience in user code. In the app however the ctx can easily be
passed through the method calls thereby reducing the performance
penalty.

This may affect extensions if they have subclassed the app and
overridden these methods.
This commit is contained in:
pgjones 2023-08-20 21:37:37 +01:00
parent 74d923515c
commit d8262aa58c
5 changed files with 80 additions and 42 deletions

View file

@ -5,7 +5,7 @@ import flask
def test_suppressed_exception_logging():
class SuppressedFlask(flask.Flask):
def log_exception(self, exc_info):
def log_exception(self, exc_info, ctx):
pass
out = StringIO()