INNER CODE UNIT · Python
get_request_logger
bobbui/json-logging-python · json_logging/__init__.py:195
def get_request_logger():
if _current_framework is None or _current_framework == '-':
raise RuntimeError(
"request_logger is only available if json_logging is inited with a web app, "
"call init_<framework_name>() to do that")
# _instance only exists once the configurator has been instantiated by init_request_instrument()
instance = getattr(_current_framework['app_request_instrumentation_configurator'], '_instance', None)
if instance is None:
raise RuntimeError("please init request instrument first, call init_request_instrument(app) to do that")
return instance.request_logger
import json_logging.frameworks
def init_flask(custom_formatter=None, enable_json=False):