diff --git a/haiku_rag_slim/haiku/rag/cli.py b/haiku_rag_slim/haiku/rag/cli.py index 1ebb45da..b22fa1f8 100644 --- a/haiku_rag_slim/haiku/rag/cli.py +++ b/haiku_rag_slim/haiku/rag/cli.py @@ -84,16 +84,20 @@ def main( # Configure logging for CLI context configure_cli_logging() - if get_config().environment == "development": - # Lazy import logfire only in development - try: - import logfire # type: ignore + # Configure logfire (only sends data if token is present) + try: + import logfire - logfire.configure(send_to_logfire="if-token-present") - logfire.instrument_pydantic_ai() - except Exception: - pass - else: + is_production = get_config().environment != "development" + logfire.configure( + send_to_logfire="if-token-present", + console=False if is_production else None, + ) + logfire.instrument_pydantic_ai() + except Exception: + pass + + if get_config().environment != "development": # Suppress warnings in production warnings.filterwarnings("ignore")