raffalib.logging

Functions

create_logger(→ logging.Logger)

Create and configure a logger.

Module Contents

raffalib.logging.create_logger(logger_name: str = '', level: str = 'INFO', rich: bool = False, fmt: str | None = None, disable_existing_loggers: bool = True) logging.Logger

Create and configure a logger.

Parameters:
  • logger_name (str) – Name for the logger. If empty, uses the root logger.

  • level (str) – Logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL). Defaults to “INFO”.

  • rich (bool) – Whether to use rich formatting for console output. Defaults to False.

  • fmt (str | None) – Custom format string for log messages. If None, uses default format.

  • disable_existing_loggers (bool) – Whether to disable existing loggers. Defaults to True.

Returns:

A configured logging.Logger instance.

Return type:

logging.Logger