Skip to content

Commit

Permalink
Follow python logging best practice in torchx/runner/events/... (#794) (
Browse files Browse the repository at this point in the history
#794)

Summary:

Do not set the log level or filters of either root or module-level loggers. Instead, configure this on each handler.

Reviewed By: AndreasBackx

Differential Revision: D51381654
  • Loading branch information
gunchu authored Nov 20, 2023
1 parent caba46a commit b24f92e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torchx/runner/events/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ def _get_or_create_logger(destination: str = "null") -> logging.Logger:
if _events_logger:
return _events_logger
logging_handler = get_logging_handler(destination)
logging_handler.setLevel(logging.DEBUG)
_events_logger = logging.getLogger(f"torchx-events-{destination}")
_events_logger.setLevel(logging.DEBUG)
# Do not propagate message to the root logger
_events_logger.propagate = False
_events_logger.addHandler(logging_handler)
Expand Down

0 comments on commit b24f92e

Please sign in to comment.