Skip to content

Commit

Permalink
logging fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cmyui committed Jun 30, 2024
1 parent 450d6e4 commit 6a18064
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 2 additions & 0 deletions app/init_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from fastapi import Response
from starlette.middleware.base import RequestResponseEndpoint

from app import logger
from app import settings
from app import state
from app.adapters import mysql
Expand All @@ -16,6 +17,7 @@

@asynccontextmanager
async def lifespan(app: FastAPI) -> AsyncIterator[None]:
logger.configure_logging()
await state.database.connect()
yield
await state.database.disconnect()
Expand Down
3 changes: 0 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
#!/usr/bin/env python3
import uvicorn

from app import logger
from app import settings


def main() -> int:
logger.configure_logging()

uvicorn.run(
"app.init_api:asgi_app",
reload=settings.CODE_HOTRELOAD,
Expand Down

0 comments on commit 6a18064

Please sign in to comment.