MCPcopy Create free account
hub / github.com/RolnickLab/climart / get_logger

Function get_logger

climart/utils/utils.py:100–110  ·  view source on GitHub ↗

Initializes multi-GPU-friendly python logger.

(name=__name__, level=logging.INFO)

Source from the content-addressed store, hash-verified

98
99
100def get_logger(name=__name__, level=logging.INFO) -> logging.Logger:
101 """Initializes multi-GPU-friendly python logger."""
102 logger = logging.getLogger(name)
103 logger.setLevel(level)
104
105 # this ensures all logging levels get marked with the rank zero decorator
106 # otherwise logs would get multiplied for each GPU process in multi-GPU setup
107 for level in ("debug", "info", "warning", "error", "exception", "fatal", "critical"):
108 setattr(logger, level, rank_zero_only(getattr(logger, level)))
109
110 return logger
111
112
113#####

Callers 9

run_modelFunction · 0.90
config_utils.pyFile · 0.90
extrasFunction · 0.90
wandb_callbacks.pyFile · 0.90
__init__Method · 0.90
normalization.pyFile · 0.90
h5_dataset.pyFile · 0.90
__init__Method · 0.90
mlp.pyFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected