LoggerManager¶
- class torch_ecg.components.LoggerManager(log_dir: str | bytes | PathLike | None = None, log_suffix: str | None = None)[source]¶
Bases:
ReprMixin
Manager of loggers.
This class manages multiple loggers and provides a unified interface to log metrics and messages.
- Parameters:
log_dir (path-like, optional) – The directory to save the log file.
log_suffix (str, optional) – The suffix of the log file.
- epoch_end(epoch: int) None [source]¶
Actions to be performed at the end of each epoch.
- Parameters:
epoch (int) – The number of the epoch.
- epoch_start(epoch: int) None [source]¶
Message logged at the start of each epoch.
- Parameters:
epoch (int) – The number of the epoch.
- classmethod from_config(config: Dict[str, Any]) LoggerManager [source]¶
Create a logger manager from a configuration.
- Parameters:
config (dict) – The configuration of the logger manager.
- Returns:
The instance of the created logger manager.
- Return type:
- log_message(msg: str, level: int = 20) None [source]¶
Log a message.
- Parameters:
msg (str) – The message to be logged.
level ({logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR, logging.CRITICAL}, optional) – The level of the message.