- Tool.to_schema() emits input_schema (Anthropic Messages API) instead of OpenAI-style parameters - QuestionManager: remove questions from _pending on answer and timeout, reject double answers, add list_pending() - core/skills/__init__.py so skills are importable as a package - revert optional-import fallbacks in logger/message_bus: nats-py and loguru are hard requirements, a broken install should fail loudly - tests for wait_for_answer happy path and timeout cleanup Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012AJLYcbTHCe45fyFnMfEin
28 lines
664 B
Python
28 lines
664 B
Python
"""Structured logging for LogiFlow AI — single loguru setup imported by all modules."""
|
|
import sys
|
|
import os
|
|
from pathlib import Path
|
|
from loguru import logger
|
|
|
|
Path("logs").mkdir(exist_ok=True)
|
|
|
|
logger.remove()
|
|
|
|
logger.add(
|
|
sys.stderr,
|
|
format="{time:YYYY-MM-DD HH:mm:ss} | {level: <8} | {name}:{function}:{line} - {message}",
|
|
level=os.getenv("LOG_LEVEL", "INFO"),
|
|
colorize=False,
|
|
)
|
|
|
|
logger.add(
|
|
"logs/logiflow_{time:YYYY-MM-DD}.log",
|
|
rotation="100 MB",
|
|
retention="30 days",
|
|
compression="gz",
|
|
level="DEBUG",
|
|
format="{time:YYYY-MM-DD HH:mm:ss} | {level: <8} | {name}:{function}:{line} - {message}",
|
|
)
|
|
|
|
__all__ = ["logger"]
|