maleo-foundation 0.1.26__py3-none-any.whl → 0.1.28__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- maleo_foundation/managers/service.py +11 -0
- {maleo_foundation-0.1.26.dist-info → maleo_foundation-0.1.28.dist-info}/METADATA +1 -1
- {maleo_foundation-0.1.26.dist-info → maleo_foundation-0.1.28.dist-info}/RECORD +5 -5
- {maleo_foundation-0.1.26.dist-info → maleo_foundation-0.1.28.dist-info}/WHEEL +0 -0
- {maleo_foundation-0.1.26.dist-info → maleo_foundation-0.1.28.dist-info}/top_level.txt +0 -0
@@ -365,17 +365,26 @@ class ServiceManager:
|
|
365
365
|
return result.data.token
|
366
366
|
|
367
367
|
def create_app(self, router:APIRouter, lifespan:Optional[Lifespan[AppType]] = None, request_processor:Optional[RequestProcessor] = None) -> FastAPI:
|
368
|
+
self._loggers.application.info("Creating FastAPI application")
|
368
369
|
self._app = FastAPI(title=self._configs.service.name, lifespan=lifespan)
|
370
|
+
self._loggers.application.info("FastAPI application created successfully")
|
369
371
|
|
372
|
+
#* Add middleware(s)
|
373
|
+
self._loggers.application.info("Configuring middlewares")
|
370
374
|
self._middleware = MiddlewareManager(app=self._app, configurations=self._configs.middleware)
|
371
375
|
self._middleware.add_all(loggers=self.loggers.middleware, key=self._keys.public, request_processor=request_processor)
|
376
|
+
self._loggers.application.info("Middlewares addedd successfully")
|
372
377
|
|
373
378
|
#* Add exception handler(s)
|
379
|
+
self._loggers.application.info("Adding exception handlers")
|
374
380
|
self._app.add_exception_handler(RequestValidationError, BaseExceptions.validation_exception_handler)
|
375
381
|
self._app.add_exception_handler(HTTPException, BaseExceptions.http_exception_handler)
|
382
|
+
self._loggers.application.info("Exception handlers addedd successfully")
|
376
383
|
|
377
384
|
#* Include router
|
385
|
+
self._loggers.application.info("Including routers")
|
378
386
|
self._app.include_router(router)
|
387
|
+
self._loggers.application.info("Routers included successfully")
|
379
388
|
|
380
389
|
return self._app
|
381
390
|
|
@@ -384,6 +393,7 @@ class ServiceManager:
|
|
384
393
|
return self._app
|
385
394
|
|
386
395
|
def run_app(self) -> None:
|
396
|
+
self._loggers.application.info("Detected environment: '%s'", self._settings.ENVIRONMENT)
|
387
397
|
if self._settings.ENVIRONMENT == BaseEnums.EnvironmentType.LOCAL:
|
388
398
|
import importlib.util
|
389
399
|
import logging
|
@@ -394,6 +404,7 @@ class ServiceManager:
|
|
394
404
|
logger = logging.getLogger(__name__)
|
395
405
|
|
396
406
|
# Get the module path and add it to sys.path if needed
|
407
|
+
logger.info("Getting spec")
|
397
408
|
spec = importlib.util.find_spec("app")
|
398
409
|
if spec and spec.origin:
|
399
410
|
module_path = os.path.dirname(os.path.dirname(spec.origin))
|
@@ -32,7 +32,7 @@ maleo_foundation/expanded_types/token.py,sha256=4fRTJw6W5MYq71NksNrWNi7qYHQ4_lQw
|
|
32
32
|
maleo_foundation/managers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
33
33
|
maleo_foundation/managers/db.py,sha256=Jf0w-9JOAG5X2quDxqqw6d2WUIX7MYGdlPGxWP0rxHs,4699
|
34
34
|
maleo_foundation/managers/middleware.py,sha256=7CDXPMb28AR7J72TWOeKFxOlMypKezEtO9mr53a88B0,4032
|
35
|
-
maleo_foundation/managers/service.py,sha256=
|
35
|
+
maleo_foundation/managers/service.py,sha256=eurfiSoJk9nl26YCDfGzsLsyh7fA0fZ9-VniSLRXZ08,21437
|
36
36
|
maleo_foundation/managers/client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
37
37
|
maleo_foundation/managers/client/base.py,sha256=K8AFV2MTZrC1jbTqxkx7eedmxodJirNIjoRXGGcppy4,1022
|
38
38
|
maleo_foundation/managers/client/http.py,sha256=dWFZlG1z4TERYBITReR5oSrlzvdhh2EtztVnsU8gCeA,2712
|
@@ -83,7 +83,7 @@ maleo_foundation/utils/logging.py,sha256=MwvZmZSA8SIdfq-knEvpYIgqnSpHcyHrZY9TVHW
|
|
83
83
|
maleo_foundation/utils/query.py,sha256=ODQ3adOYQNj5E2cRW9ytbjBz56nEDcnfq8mQ6YZbCCM,4375
|
84
84
|
maleo_foundation/utils/formatter/__init__.py,sha256=iKf5YCbEdg1qKnFHyKqqcQbqAqEeRUf8mhI3v3dQoj8,78
|
85
85
|
maleo_foundation/utils/formatter/case.py,sha256=TmvvlfzGdC_omMTB5vAa40TZBxQ3hnr-SYeo0M52Rlg,1352
|
86
|
-
maleo_foundation-0.1.
|
87
|
-
maleo_foundation-0.1.
|
88
|
-
maleo_foundation-0.1.
|
89
|
-
maleo_foundation-0.1.
|
86
|
+
maleo_foundation-0.1.28.dist-info/METADATA,sha256=7L0bYlqb2NlFBC2KoGS2ALJuTPzXgXP_0x807f4cypk,3190
|
87
|
+
maleo_foundation-0.1.28.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
|
88
|
+
maleo_foundation-0.1.28.dist-info/top_level.txt,sha256=_iBos3F_bhEOdjOnzeiEYSrCucasc810xXtLBXI8cQc,17
|
89
|
+
maleo_foundation-0.1.28.dist-info/RECORD,,
|
File without changes
|
File without changes
|