I want to register some data from context variables ( request , session ) during registration during a flash drive request, but use the default behavior if not.
I am using a try ... except block in logging.formatter . Is there a better way to check the request context?
try: record.user = session['user_name'] record.very_important_data = request.super_secret except Exception: record.user = None
python flask logging werkzeug
ubombi
source share