Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"ms-python.vscode-python-envs",
"redhat.vscode-xml",
"redhat.vscode-yaml",
"renesaarsoo.sql-formatter-vsc"
"renesaarsoo.sql-formatter-vsc",
"tamasfe.even-better-toml"
]
}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ENV SETUPTOOLS_SCM_PRETEND_VERSION=${REVISION} \
PATH="/opt/app/.venv/bin:$PATH" \
UV_COMPILE_BYTECODE=1 \
UV_LINK_MODE=copy
COPY --from=ghcr.io/astral-sh/uv:0.9 /uv /uvx /bin/
COPY --from=ghcr.io/astral-sh/uv:0.11 /uv /uvx /bin/
COPY pyproject.toml uv.lock README.md LICENSE alembic.ini ./
COPY app ./app
COPY migrations ./migrations
Expand Down
3 changes: 2 additions & 1 deletion app/core/settings.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import logging
from pathlib import Path

from pydantic_settings import BaseSettings
Expand All @@ -7,7 +8,7 @@ class Settings(BaseSettings):
# -------------------------------------------------------------------------
# LOGGING
# -------------------------------------------------------------------------
log_level: str = "INFO"
log_level: int = logging.INFO
log_file: Path = Path.home() / ".fastapitemplate" / "app.log"
log_file_max_size: int = 25 * 1024 * 1024
log_file_backup_count: int = 7
Expand Down
3 changes: 1 addition & 2 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@


def configure_logging() -> None:
level = getattr(logging, settings.log_level.upper())
handlers: list[logging.Handler] = [logging.StreamHandler()]

if settings.log_file:
Expand All @@ -31,7 +30,7 @@ def configure_logging() -> None:
handlers.append(file_handler)

logging.basicConfig(
level=level,
level=settings.log_level,
format=settings.log_format,
handlers=handlers,
)
Expand Down
Loading