INNER CODE UNIT · Python
_SuppressPollLog
Chanchaldhiman/CANviz · backend/canviz/server.py:32
class _SuppressPollLog(logging.Filter):
_MUTED = {"/status", "/canopen/status"}
def filter(self, record: logging.LogRecord) -> bool:
msg = record.getMessage()
return not any(p in msg for p in self._MUTED)
logging.getLogger("uvicorn.access").addFilter(_SuppressPollLog())
@asynccontextmanager
async def lifespan(app: FastAPI):
# startup - connections opened on demand via /connect
yield
# shutdown - clean up bus and broadcaster gracefully
await broadcaster.stop()
await bus_manager._hard_shutdown()