Skip to content

Commit

Permalink
bump to 0.0.12
Browse files Browse the repository at this point in the history
small refactor
  • Loading branch information
bobevenup committed Feb 26, 2019
1 parent 89fb498 commit a5076a6
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions json_logging/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ def config_root_logger():
_logger.debug("Update root logger to using JSONLogFormatter")
if len(logging.root.handlers) > 0:
if _current_framework is not None or _current_framework != '-':
util.use_cf_logging_formatter([logging.root], JSONLogWebFormatter)
util.update_formatter_for_loggers([logging.root], JSONLogWebFormatter)
else:
util.use_cf_logging_formatter([logging.root], JSONLogFormatter)
util.update_formatter_for_loggers([logging.root], JSONLogFormatter)
# remove all handlers for request logging
request_logger = _current_framework['app_request_instrumentation_configurator']().get_request_logger()
if request_logger:
Expand Down Expand Up @@ -143,7 +143,7 @@ def init(framework_name=None, custom_formatter=None):
# go to all the initialized logger and update it to use JSON formatter
_logger.debug("Update all existing logger to using JSONLogFormatter")
existing_loggers = list(map(logging.getLogger, logging.Logger.manager.loggerDict))
util.use_cf_logging_formatter(existing_loggers, formatter)
util.update_formatter_for_loggers(existing_loggers, formatter)


def init_request_instrument(app=None):
Expand Down
2 changes: 1 addition & 1 deletion json_logging/framework/flask/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def config(self, app):
# Disable standard logging
logging.getLogger('werkzeug').disabled = True

json_logging.util.use_cf_logging_formatter([logging.getLogger('werkzeug')], JSONLogWebFormatter)
json_logging.util.update_formatter_for_loggers([logging.getLogger('werkzeug')], JSONLogWebFormatter)

# noinspection PyAttributeOutsideInit
self.request_logger = logging.getLogger('flask-request-logger')
Expand Down
2 changes: 1 addition & 1 deletion json_logging/framework/quart/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def config(self, app):
logging.getLogger('quart.app').removeHandler(default_handler)
logging.getLogger('quart.serving').removeHandler(serving_handler)

json_logging.util.use_cf_logging_formatter([
json_logging.util.update_formatter_for_loggers([
# logging.getLogger('quart.app'),
# logging.getLogger('quart.serving'),
], JSONLogWebFormatter)
Expand Down
2 changes: 1 addition & 1 deletion json_logging/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def get_library_logger(logger_name):
return logger


def use_cf_logging_formatter(loggers_iter, formatter):
def update_formatter_for_loggers(loggers_iter, formatter):
"""
:param formatter:
:param loggers_iter:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

setup(
name="json-logging",
version='0.0.11',
version='0.0.12',
packages=find_packages(exclude=['contrib', 'docs', 'tests*', 'example', 'dist', 'build']),
license='Apache License 2.0',
description="JSON Python Logging",
Expand Down

0 comments on commit a5076a6

Please sign in to comment.