INNER CODE UNIT · Python
__init
bobbui/json-logging-python · json_logging/__init__.py:88
def __init(framework_name=None, custom_formatter=None, enable_json=False):
"""
Initialize JSON logging support, if no **framework_name** passed, logging will be initialized in non-web context.
This is supposed to be called only one time.
If **custom_formatter** is passed, it will (in non-web context) use this formatter over the default.
:param framework_name: type of framework logging should support.DEFAULT_CORRELATION_ID_HEADERS
:param custom_formatter: formatter to override default JSONLogFormatter.
"""
global _current_framework
global ENABLE_JSON_LOGGING
global _default_formatter
if _current_framework is not None:
raise RuntimeError("Can not call init more than once")