Skip to content

Commit

Permalink
Merged with jf/find
Browse files Browse the repository at this point in the history
  • Loading branch information
John Furr authored and John Furr committed Oct 2, 2016
2 parents b3da234 + aa3d29e commit db9af31
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mongolog/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
uuid_namespace = uuid.UUID('8296424f-28b7-5982-a434-e6ec8ef529b3')

# TODO Move to mongolog.models.Mongolog
def get_mongolog_handler(logger_name=None):
def get_mongolog_handler(logger_name=None, show_logger_names=False):
"""
Return the first MongoLogHander found in the list of defined loggers.
NOTE: If more than one is defined, only the first one is used.
Expand All @@ -48,7 +48,9 @@ def get_mongolog_handler(logger_name=None):
logger_names = [logger_name]
else:
logger_names = [''] + list(logging.Logger.manager.loggerDict)
console.info("get_mongolog_handler(): Logger_names: %s", json.dumps(logger_names, indent=4, sort_keys=True, default=str))

if show_logger_names:
console.info("get_mongolog_handler(): Logger_names: %s", json.dumps(logger_names, indent=4, sort_keys=True, default=str))

for name in logger_names:
logger = logging.getLogger(name)
Expand Down

0 comments on commit db9af31

Please sign in to comment.