Skip to content

Commit a5076a6

Browse files
committed
bump to 0.0.12
small refactor
1 parent 89fb498 commit a5076a6

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

json_logging/__init__.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ def config_root_logger():
8181
_logger.debug("Update root logger to using JSONLogFormatter")
8282
if len(logging.root.handlers) > 0:
8383
if _current_framework is not None or _current_framework != '-':
84-
util.use_cf_logging_formatter([logging.root], JSONLogWebFormatter)
84+
util.update_formatter_for_loggers([logging.root], JSONLogWebFormatter)
8585
else:
86-
util.use_cf_logging_formatter([logging.root], JSONLogFormatter)
86+
util.update_formatter_for_loggers([logging.root], JSONLogFormatter)
8787
# remove all handlers for request logging
8888
request_logger = _current_framework['app_request_instrumentation_configurator']().get_request_logger()
8989
if request_logger:
@@ -143,7 +143,7 @@ def init(framework_name=None, custom_formatter=None):
143143
# go to all the initialized logger and update it to use JSON formatter
144144
_logger.debug("Update all existing logger to using JSONLogFormatter")
145145
existing_loggers = list(map(logging.getLogger, logging.Logger.manager.loggerDict))
146-
util.use_cf_logging_formatter(existing_loggers, formatter)
146+
util.update_formatter_for_loggers(existing_loggers, formatter)
147147

148148

149149
def init_request_instrument(app=None):

json_logging/framework/flask/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def config(self, app):
3636
# Disable standard logging
3737
logging.getLogger('werkzeug').disabled = True
3838

39-
json_logging.util.use_cf_logging_formatter([logging.getLogger('werkzeug')], JSONLogWebFormatter)
39+
json_logging.util.update_formatter_for_loggers([logging.getLogger('werkzeug')], JSONLogWebFormatter)
4040

4141
# noinspection PyAttributeOutsideInit
4242
self.request_logger = logging.getLogger('flask-request-logger')

json_logging/framework/quart/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def config(self, app):
3838
logging.getLogger('quart.app').removeHandler(default_handler)
3939
logging.getLogger('quart.serving').removeHandler(serving_handler)
4040

41-
json_logging.util.use_cf_logging_formatter([
41+
json_logging.util.update_formatter_for_loggers([
4242
# logging.getLogger('quart.app'),
4343
# logging.getLogger('quart.serving'),
4444
], JSONLogWebFormatter)

json_logging/util.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def get_library_logger(logger_name):
3434
return logger
3535

3636

37-
def use_cf_logging_formatter(loggers_iter, formatter):
37+
def update_formatter_for_loggers(loggers_iter, formatter):
3838
"""
3939
:param formatter:
4040
:param loggers_iter:

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
setup(
1414
name="json-logging",
15-
version='0.0.11',
15+
version='0.0.12',
1616
packages=find_packages(exclude=['contrib', 'docs', 'tests*', 'example', 'dist', 'build']),
1717
license='Apache License 2.0',
1818
description="JSON Python Logging",

0 commit comments

Comments
 (0)