improved logging

This commit is contained in:
Ayzen
2026-06-06 00:52:52 +03:00
parent af6005d68f
commit aea49f6128
65 changed files with 1206 additions and 240 deletions
+5
View File
@@ -10,6 +10,7 @@ static single-page frontend is mounted at ``/`` and the JSON/WS API under
from __future__ import annotations
from contextlib import asynccontextmanager
import logging
from pathlib import Path
from fastapi import FastAPI
@@ -19,6 +20,8 @@ from python_app.webui.controller import WebController
from python_app.webui.routes import router
from python_app.webui.streaming import RingBroadcaster
logger = logging.getLogger(__name__)
_STATIC_DIR = Path(__file__).resolve().parent / "static"
@@ -31,10 +34,12 @@ def create_app(controller: WebController) -> FastAPI:
app.state.controller = controller
app.state.broadcaster = broadcaster
broadcaster.start()
logger.info("Web UI application started")
try:
yield
finally:
await broadcaster.stop()
logger.info("Web UI application stopped")
app = FastAPI(title="Radar Web UI", lifespan=lifespan)
app.include_router(router)