alessandro trinca tornidor
[feat] add uuid session logger, add typing hints on function arguments
90dbc1a
raw
history blame
423 Bytes
import json
import logging
from fastapi import APIRouter
from app_gradio_fastapi.helpers import session_logger
router = APIRouter()
@router.get("/health")
@session_logger.set_uuid_logging
def health() -> str:
try:
logging.info("health check")
return json.dumps({"msg": "ok"})
except Exception as e:
logging.error(f"exception:{e}.")
return json.dumps({"msg": "request failed"})