Usage:
The logger is initialized with a name and a parallel context, and it offers standard logging methods (info, warning, debug, error) with additional parameters for rank and parallel mode.
Example:
logger = DistributedLogger("example_logger", parallel_context)
logger.info("Information message", rank=0, parallel_mode=ParallelMode.GLOBAL) # Assuming rank is 0 in parallel_context
logger.warning("This is a WARNING message", parallel_mode=ParallelMode.GLOBAL)
logger.debug("This is a DEBUG message", parallel_mode=ParallelMode.GLOBAL)
logger.error("This is an ERROR message", parallel_mode=ParallelMode.GLOBAL)
The logger's behavior, such as which messages are logged and where they are saved, is determined by the rank and parallel mode passed to these methods.
Usage: The logger is initialized with a name and a parallel context, and it offers standard logging methods (info, warning, debug, error) with additional parameters for rank and parallel mode.
Example:
The logger's behavior, such as which messages are logged and where they are saved, is determined by the rank and parallel mode passed to these methods.