mlfmu.utils.logging¶
Functions to configure logging for the application.
Functions
|
Configure logging for the application, allowing for both console and file logging. |
- mlfmu.utils.logging.configure_logging(log_level_console: str = 'WARNING', log_file: Path | None = None, log_level_file: str = 'WARNING') None ¶
Configure logging for the application, allowing for both console and file logging.
Sets the log levels and formats for the output, ensuring that logs are captured as specified.
- Parameters:
log_level_console (str) – The logging level for console output. Defaults to “WARNING”.
log_file (Path | None) – The path to the log file. If None, file logging is disabled. Defaults to None.
log_level_file (str) – The logging level for file output. Defaults to “WARNING”.
- Raises:
TypeError – If the provided log levels are invalid.:
Examples
configure_logging(log_level_console=”INFO”, log_file=Path(“app.log”), log_level_file=”DEBUG”)