feat(logging): implement configurable belief state logging

- Add LoggingConfig model and logging field to GlobalSettings
- Implement belief_scope context manager for structured logging
- Add configure_logger for dynamic level and file rotation settings
- Add logging configuration UI to Settings page
- Update ConfigManager to apply logging settings on initialization and updates
This commit is contained in:
2025-12-27 05:39:33 +03:00
parent d197303b9f
commit 83e34e1799
10 changed files with 224 additions and 24 deletions

View File

@@ -15,6 +15,7 @@ from backend.src.dependencies import get_config_manager
from backend.src.core.superset_client import SupersetClient
from superset_tool.models import SupersetConfig
from pydantic import BaseModel
from backend.src.core.logger import logger
# [/SECTION]
router = APIRouter(prefix="/api/environments", tags=["environments"])
@@ -38,7 +39,9 @@ class DatabaseResponse(BaseModel):
# @RETURN: List[EnvironmentResponse]
@router.get("", response_model=List[EnvironmentResponse])
async def get_environments(config_manager=Depends(get_config_manager)):
logger.info(f"[get_environments][Debug] Config path: {config_manager.config_path}")
envs = config_manager.get_environments()
logger.info(f"[get_environments][Debug] Found {len(envs)} environments")
return [EnvironmentResponse(id=e.id, name=e.name, url=e.url) for e in envs]
# [/DEF:get_environments]