Skip to content

datarobot_genai.core.utils.logging

logging

setup_logging

setup_logging() -> None

Setup uniform logging for the application.

Source code in datarobot_genai/core/utils/logging.py
def setup_logging() -> None:
    """Setup uniform logging for the application."""  # noqa: D401
    current_log_level = logging.getLogger().getEffectiveLevel()
    logger.info(f"Setting up logging, log level: {logging._levelToName[current_log_level]}")

    # Import litellm so its module-level handler registration runs before we strip it.
    try:
        import litellm  # noqa: F401, PLC0415
    except ImportError:
        pass

    _configure_litellm_loggers()