component_model.utils.logging

Functions to configure logging for the application.

Functions

configure_logging([log_level_console, ...])

Configure logging for the application, allowing for both console and file logging.

component_model.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, optional) – log level for console output, by default “WARNING”

  • log_file (Path | None, optional) – log file to be used. If None, file logging is disabled. by default None

  • log_level_file (str, optional) – log level for file output, by default “WARNING”

Raises:

TypeError – if an invalid value for log_level_console or log_level_file is passed

Examples

configure_logging(log_level_console=”INFO”, log_file=Path(“app.log”), log_level_file=”DEBUG”)