Skip to content

Cannot set log level of ignite.distributed because of calls to setup_logger inside auto functions #1763

@schuhschuh

Description

@schuhschuh

🐛 Bug description

The ignite.distributed auto functions such as ignite.distributed.auto_dataloader use setup_logger to get a logging.Logger instance. However, this function always sets the logging level to logging.INFO and furthermore removes ands sets up the logging handlers. Functions should not be setting up a logger object if it is already initialized such that user code can specify a different log level, handlers, or log message format string in their code (e.g., main function).

See for example:

Note that in case of ignite.distributed.launcher.Parallel one can modify the self.logger instance, but this logger already prints messages right after setup_logger in its __init__ function, hence, making it impossible to adjust the log level, format, or handlers for these first messages also.

Environment

  • PyTorch Version (e.g., 1.4):
  • Ignite Version (e.g., 0.3.0):
  • OS (e.g., Linux):
  • How you installed Ignite (conda, pip, source):
  • Python version:
  • Any other relevant information:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions