helios.core.loggers.base¶
Classes¶
Base class for all Helios' loggers. |
Functions¶
|
Generate the default name used for loggers. |
Module Contents¶
- class helios.core.loggers.base.Logger[source]¶
Bases:
abc.ABCBase class for all Helios’ loggers.
- Each logger sub-class is in charge of the following:
Their own storage (if applicable) under
log_root.Their own persistent settings so they can be resumed.
- abstractmethod setup(run_name: str, log_root: pathlib.Path | None, is_resume: bool) None[source]¶
Finish configuring the logger.
Called after the logger has been created. If the logger is being restored, then this is called after
load_state_dict()is called. Each derived class should configure its own folder underlog_rootand create it as needed.- Parameters:
run_name – the name of the current run.
log_root – root directory for all logs.
Nonemeans no on-disk output is desired.is_resume –
Truewhen continuing a previous run.
- abstractmethod state_dict() dict[str, Any][source]¶
Return a dictionary containing the logger state.
- Returns:
A dictionary that can be passed to
load_state_dict()to restore the logger to the same state.
- abstractmethod load_state_dict(state_dict: dict[str, Any]) None[source]¶
Restore the logger state from a previously saved dictionary.
Must be called before
setup()when resuming so thatsetupcan use the saved paths.- Parameters:
state_dict – the state dictionary returned by a prior call to
state_dict().