espnet3.utils.logging_utils.build_qualified_name
Less than 1 minute
espnet3.utils.logging_utils.build_qualified_name
espnet3.utils.logging_utils.build_qualified_name(obj) → str
Return a compact, fully-qualified name for objects or classes.
Description: : Produces a stable, human-readable identifier for logging and debugging. For objects, it prefers the object’s class path. For builtins without a module path, it falls back to a truncated string, and includes length when available.
- Parameters:obj – Any object or class.
- Returns: A fully-qualified name or a compact string representation.
- Return type: str
Notes
- Builtin types (e.g., list, dict) return “ListClass(len=…)” when possible, otherwise a truncated string.
- For classes, the class module and name are returned.
Examples
```python from pathlib import Path build_qualified_name(Path(“/tmp”))
=> ‘pathlib.PosixPath’
build_qualified_name(Path)
=> ‘pathlib.Path’
build_qualified_name([1, 2, 3])
=> ‘list(len=3)’
```