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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ The project is organized into the following directories and files:

## Pre-Commit Setup

If you are using this project then pre-commit setup would be very helpful for checking your codebase. In short, pre-commit is a tool that allows developers to define and apply automated checks to their code before they commit it to a version control system. You can find more info [here](https://pre-commit.com)
If you are using this project then pre-commit setup would be very helpful for checking your codebase. In short, pre-commit is a tool that allows developers to define and apply automated checks to their code before they commit it to a version control system. You can find more info [here](https://pre-commit.com).


```commandline
Expand Down
2 changes: 1 addition & 1 deletion fastapi_app/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from sqlalchemy.orm import sessionmaker
from fastapi_app import config, utils

logger = utils.AppLogger.__call__().get_logger()
logger = utils.AppLogger().get_logger()

engine = create_async_engine(
config.get_settings().database_url,
Expand Down
2 changes: 1 addition & 1 deletion fastapi_app/subapps/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from fastapi_app.background_tasks import calculate_event_documentation
from fastapi_app.schemas import api as schemas_api

logger = utils.AppLogger.__call__().get_logger()
logger = utils.AppLogger().get_logger()

client_app = FastAPI(
dependencies=[
Expand Down
2 changes: 1 addition & 1 deletion fastapi_app/subapps/web_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from fastapi_app.schemas import api as schemas_api
from uuid import UUID

logger = utils.AppLogger.__call__().get_logger()
logger = utils.AppLogger().get_logger()


def custom_generate_unique_id(route: APIRoute) -> str:
Expand Down
2 changes: 1 addition & 1 deletion fastapi_app/utils/init_supertokens.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

settings = config.get_settings()

logger = AppLogger.__call__().get_logger()
logger = AppLogger().get_logger()


class GitHubApiError(Exception):
Expand Down
4 changes: 2 additions & 2 deletions fastapi_app/utils/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@


class AppLogger(metaclass=SingletonMeta):
_logger = None
_logger: logging.Logger

def __init__(self) -> None:
self._logger = logging.getLogger(__name__)

def get_logger(self) -> logging.Logger | None:
def get_logger(self) -> logging.Logger:
return self._logger


Expand Down
2 changes: 1 addition & 1 deletion fastapi_app/utils/route_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from fastapi.routing import APIRoute
from .logger import AppLogger

logger = AppLogger.__call__().get_logger()
logger = AppLogger().get_logger()


# log request body on validation error
Expand Down