Skip to content

Commit 664feaa

Browse files
authored
Remove redunant __call__ from logger calls; Addresses #6 (#7)
1 parent 211c80b commit 664feaa

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ The project is organized into the following directories and files:
7676

7777
## Pre-Commit Setup
7878

79-
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)
79+
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).
8080

8181

8282
```commandline

fastapi_app/database.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from sqlalchemy.orm import sessionmaker
44
from fastapi_app import config, utils
55

6-
logger = utils.AppLogger.__call__().get_logger()
6+
logger = utils.AppLogger().get_logger()
77

88
engine = create_async_engine(
99
config.get_settings().database_url,

fastapi_app/subapps/client.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from fastapi_app.background_tasks import calculate_event_documentation
1212
from fastapi_app.schemas import api as schemas_api
1313

14-
logger = utils.AppLogger.__call__().get_logger()
14+
logger = utils.AppLogger().get_logger()
1515

1616
client_app = FastAPI(
1717
dependencies=[

fastapi_app/subapps/web_app.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from fastapi_app.schemas import api as schemas_api
1111
from uuid import UUID
1212

13-
logger = utils.AppLogger.__call__().get_logger()
13+
logger = utils.AppLogger().get_logger()
1414

1515

1616
def custom_generate_unique_id(route: APIRoute) -> str:

fastapi_app/utils/init_supertokens.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
settings = config.get_settings()
2020

21-
logger = AppLogger.__call__().get_logger()
21+
logger = AppLogger().get_logger()
2222

2323

2424
class GitHubApiError(Exception):

fastapi_app/utils/logger.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66

77

88
class AppLogger(metaclass=SingletonMeta):
9-
_logger = None
9+
_logger: logging.Logger
1010

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

14-
def get_logger(self) -> logging.Logger | None:
14+
def get_logger(self) -> logging.Logger:
1515
return self._logger
1616

1717

fastapi_app/utils/route_handler.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from fastapi.routing import APIRoute
55
from .logger import AppLogger
66

7-
logger = AppLogger.__call__().get_logger()
7+
logger = AppLogger().get_logger()
88

99

1010
# log request body on validation error

0 commit comments

Comments
 (0)