espnet3.utils.logging.configure_logging
Less than 1 minute
espnet3.utils.logging.configure_logging
espnet3.utils.logging.configure_logging(, log_dir: Path | None = None, level: int = 20, filename: str = 'run.log') → Logger
Configure logging for an ESPnet3 run.
This sets up: : - A root logger with a stream handler (console).
- An optional file handler at log_dir/filename.
- Warning capture into the logging system.
- Parameters:
- log_dir (Path | None) – Directory to store the log file. If None, only console logging is configured.
- level (int) – Logging level (e.g., logging.INFO).
- filename (str) – Log file name when log_dir is provided.
- Returns: Logger instance named “espnet3”.
- Return type: logging.Logger
Example
>>> from pathlib import Path
>>> logger = configure_logging(log_dir=Path("exp/logs"))
>>> logger.name
'espnet3'