Skip to content

_logging

_logging

Logging utilities for terok-sandbox.

log_debug(message)

Append a DEBUG line to the terok-sandbox log.

Source code in src/terok_sandbox/_util/_logging.py
def log_debug(message: str) -> None:
    """Append a DEBUG line to the terok-sandbox log."""
    _log(message, level="DEBUG")

log_warning(message)

Append a WARNING line to the terok-sandbox log.

Source code in src/terok_sandbox/_util/_logging.py
def log_warning(message: str) -> None:
    """Append a WARNING line to the terok-sandbox log."""
    _log(message, level="WARNING")

warn_user(component, message)

Print a structured warning to stderr and log it.

Source code in src/terok_sandbox/_util/_logging.py
def warn_user(component: str, message: str) -> None:
    """Print a structured warning to stderr and log it."""
    import sys

    try:
        print(f"Warning [{component}]: {message}", file=sys.stderr)
    except Exception:
        pass
    log_warning(f"[{component}] {message}")