espnet3.utils.logging_utils.log_instance_dict
Less than 1 minute
espnet3.utils.logging_utils.log_instance_dict
espnet3.utils.logging_utils.log_instance_dict(logger: Logger, kind: str, entries: dict[str, object], max_depth: int = 2) → None
Log a dictionary of instances with a common kind label.
Description: : Iterates over the provided mapping and logs each value using the shared kind label. This is useful for dumping collections of structured objects (e.g., environment info blocks or component registries) in a consistent, readable format.
- Parameters:
- logger (logging.Logger) – Logger used to emit messages.
- kind (str) – Label prefix for each entry (e.g., “Env”, “Component”).
- entries (dict *[*str , object ]) – Mapping from entry keys to objects.
- max_depth (int) – Maximum depth for attribute dumping.
- Returns: None
Notes
- Empty mappings are ignored.
- Each entry is logged via log_component, which emits a class line, a repr line, and selected public attributes.
Examples
```python log_instance_dict(
logger, kind=”Env”, entries={“CUDA”: torch.cuda, “NCCL”: nccl_module},
)
- raises None:
