Skip to content

Log

warn_once(msg) cached

Log a warning message only once by caching the function call.

Source code in src/kibad_llm/utils/log.py
 7
 8
 9
10
@lru_cache(maxsize=None)
def warn_once(msg: str) -> None:
    """Log a warning message only once by caching the function call."""
    logger.warning(f"{msg} (this message will only be shown once)")