Spaces:
Configuration error
Configuration error
Download backend/app/api/logs.py from prathammodels/smart-attendance-api: direct link, hf CLI and curl.
- Browser
- Download file 540 Bytes
-
https://huggingface.co/spaces/prathammodels/smart-attendance-api/resolve/main/backend/app/api/logs.py
- Command line
-
hf download hf://spaces/prathammodels/smart-attendance-api/backend/app/api/logs.py
-
curl -L -o logs.py https://huggingface.co/spaces/prathammodels/smart-attendance-api/resolve/main/backend/app/api/logs.py
540 Bytes
| import logging | |
| from fastapi import APIRouter, status | |
| from app.core.logging_config import get_logger | |
| from app.schemas.log import LogEvent | |
| router = APIRouter(prefix="/logs", tags=["Logging"]) | |
| logger = get_logger("app.client") | |
| async def ingest_log(log_event: LogEvent) -> dict: | |
| logger.log( | |
| getattr(logging, log_event.level.upper(), logging.INFO), | |
| "[%s] [%s] %s", | |
| log_event.source, log_event.timestamp, log_event.message, | |
| ) | |
| return {"status": "success"} | |