Add logging

This commit is contained in:
2025-11-14 17:33:32 +00:00
parent a2bd68ad09
commit 304227c5f3
+15 -1
View File
@@ -34,7 +34,14 @@ os.environ["ANONYMIZED_TELEMETRY"] = "False"
# -----------------------------
# Configuration
# -----------------------------
logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s")
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s - %(levelname)s - %(message)s",
handlers=[
logging.FileHandler("mcp_codebase.log"), # Log to file
logging.StreamHandler() # Also log to console
]
)
logger = logging.getLogger("rag-mcp")
OLLAMA_BASE_URL = "http://127.0.0.1:11434"
@@ -2090,6 +2097,13 @@ def build_indexes():
# -------------------------------------------------
texts, metadatas = index_codebase(CODEBASE_PATH)
logger.info("=== Sample metadata inspection ===")
for i, m in enumerate(metadatas[:5]): # Check first 5
logger.info(f"Chunk {i}: type={m.get('type')}, name={m.get('name')}")
logger.info(f" imports={m.get('imports')}")
logger.info(f" calls={m.get('calls')}")
logger.info(f" parameters={m.get('parameters')}")
# FIX: Convert Path to string for LocalGraph
graph = LocalGraph(root_path=str(CODEBASE_PATH))
graph.clear()