maleo-foundation 0.0.100__tar.gz → 0.1.1__tar.gz
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-0.0.100 → maleo_foundation-0.1.1}/PKG-INFO +1 -1
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/managers/service.py +13 -3
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/utils/logging.py +24 -1
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation.egg-info/PKG-INFO +1 -1
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/pyproject.toml +1 -1
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/README.md +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/__init__.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/clients/__init__.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/clients/general/__init__.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/clients/general/http.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/clients/google/__init__.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/clients/google/base.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/clients/google/cloud/__init__.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/clients/google/cloud/base.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/clients/google/cloud/logging.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/clients/google/cloud/secret.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/clients/google/cloud/storage.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/clients/google/secret.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/clients/google/storage.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/clients/utils/__init__.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/clients/utils/logger.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/constants.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/db/__init__.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/db/engine.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/db/manager.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/db/session.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/db/table.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/enums.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/expanded_types/__init__.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/expanded_types/client.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/expanded_types/general.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/expanded_types/query.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/expanded_types/service.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/expanded_types/token.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/extended_types.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/managers/__init__.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/managers/client/__init__.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/managers/client/base.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/managers/client/google/__init__.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/managers/client/google/base.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/managers/client/google/secret.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/managers/client/google/storage.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/managers/client/http.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/managers/db.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/middlewares/__init__.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/middlewares/base.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/middlewares/cors.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/models/__init__.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/models/responses.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/models/schemas/__init__.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/models/schemas/general.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/models/schemas/parameter.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/models/schemas/result.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/models/schemas/token.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/models/transfers/__init__.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/models/transfers/general/__init__.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/models/transfers/general/token.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/models/transfers/parameters/__init__.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/models/transfers/parameters/client.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/models/transfers/parameters/general.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/models/transfers/parameters/service.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/models/transfers/parameters/token.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/models/transfers/results/__init__.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/models/transfers/results/client/__init__.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/models/transfers/results/client/controllers/__init__.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/models/transfers/results/client/controllers/http.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/models/transfers/results/client/service.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/models/transfers/results/service/__init__.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/models/transfers/results/service/controllers/__init__.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/models/transfers/results/service/controllers/rest.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/models/transfers/results/service/general.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/models/transfers/results/service/query.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/models/transfers/results/token.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/services/__init__.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/services/token.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/types.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/utils/__init__.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/utils/controller.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/utils/exceptions.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/utils/formatter/__init__.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/utils/formatter/case.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/utils/keyloader.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/utils/logger.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/utils/query.py +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation.egg-info/SOURCES.txt +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation.egg-info/dependency_links.txt +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation.egg-info/requires.txt +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation.egg-info/top_level.txt +0 -0
- {maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/setup.cfg +0 -0
@@ -15,7 +15,7 @@ from maleo_foundation.managers.db import DatabaseManager
|
|
15
15
|
from maleo_foundation.services.token import BaseTokenService
|
16
16
|
from maleo_foundation.types import BaseTypes
|
17
17
|
from maleo_foundation.utils.keyloader import load_key
|
18
|
-
from maleo_foundation.utils.logging import GoogleCloudLogging, ServiceLogger
|
18
|
+
from maleo_foundation.utils.logging import GoogleCloudLogging, ServiceLogger, ClientLoggerManager
|
19
19
|
|
20
20
|
class Settings(BaseSettings):
|
21
21
|
GOOGLE_CREDENTIALS_PATH:str = Field("/creds/maleo-google-service-account.json", description="Internal credential's file path")
|
@@ -84,10 +84,13 @@ class Configurations(BaseModel):
|
|
84
84
|
class Config:
|
85
85
|
arbitrary_types_allowed=True
|
86
86
|
|
87
|
+
ClientLoggerManagers = Dict[str, ClientLoggerManager]
|
88
|
+
|
87
89
|
class Loggers(BaseModel):
|
88
90
|
application:ServiceLogger = Field(..., description="Application logger")
|
89
91
|
database:ServiceLogger = Field(..., description="Database logger")
|
90
92
|
middleware:ServiceLogger = Field(..., description="Middleware logger")
|
93
|
+
client:ClientLoggerManagers = Field(default_factory=dict, description="Client logger manager")
|
91
94
|
|
92
95
|
class Config:
|
93
96
|
arbitrary_types_allowed=True
|
@@ -112,7 +115,8 @@ class ServiceManager:
|
|
112
115
|
db_metadata:MetaData,
|
113
116
|
base_dir:BaseTypes.OptionalString = None,
|
114
117
|
settings:Optional[Settings] = None,
|
115
|
-
google_cloud_logging:Optional[GoogleCloudLogging] = None
|
118
|
+
google_cloud_logging:Optional[GoogleCloudLogging] = None,
|
119
|
+
client_logger_managers:ClientLoggerManagers = {}
|
116
120
|
):
|
117
121
|
self._db_metadata = db_metadata
|
118
122
|
|
@@ -138,6 +142,7 @@ class ServiceManager:
|
|
138
142
|
else:
|
139
143
|
self._google_cloud_logging = google_cloud_logging
|
140
144
|
|
145
|
+
self._client_logger_managers = client_logger_managers
|
141
146
|
self._initialize_loggers()
|
142
147
|
self._load_credentials()
|
143
148
|
self._parse_keys()
|
@@ -169,7 +174,11 @@ class ServiceManager:
|
|
169
174
|
application = ServiceLogger(logs_dir=self._logs_dir, type=BaseEnums.LoggerType.APPLICATION, google_cloud_logging=self._google_cloud_logging)
|
170
175
|
database = ServiceLogger(logs_dir=self._logs_dir, type=BaseEnums.LoggerType.DATABASE, google_cloud_logging=self._google_cloud_logging)
|
171
176
|
middleware = ServiceLogger(logs_dir=self._logs_dir, type=BaseEnums.LoggerType.MIDDLEWARE, google_cloud_logging=self._google_cloud_logging)
|
172
|
-
|
177
|
+
client = self._client_logger_managers
|
178
|
+
for key, logger_manager in client.items():
|
179
|
+
application.info(f"Initializing logger manager for client '{key}'")
|
180
|
+
logger_manager.initialize()
|
181
|
+
self._loggers = Loggers(application=application, database=database, middleware=middleware, client=client)
|
173
182
|
|
174
183
|
@property
|
175
184
|
def loggers(self) -> Loggers:
|
@@ -258,6 +267,7 @@ class ServiceManager:
|
|
258
267
|
return result.data.token
|
259
268
|
|
260
269
|
async def dispose(self) -> None:
|
270
|
+
self._loggers.application.info("Disposing service manager")
|
261
271
|
if self._database is not None:
|
262
272
|
self._database.dispose()
|
263
273
|
self._database = None
|
@@ -179,4 +179,27 @@ class ClientLogger(BaseLogger):
|
|
179
179
|
client_key=client_key,
|
180
180
|
level=level,
|
181
181
|
google_cloud_logging=google_cloud_logging
|
182
|
-
)
|
182
|
+
)
|
183
|
+
|
184
|
+
class ClientLoggerManager:
|
185
|
+
_logger:Optional[ClientLogger] = None
|
186
|
+
|
187
|
+
@classmethod
|
188
|
+
def initialize(
|
189
|
+
cls,
|
190
|
+
logs_dir:str,
|
191
|
+
client_key:str,
|
192
|
+
service_key:BaseTypes.OptionalString = None,
|
193
|
+
level:BaseEnums.LoggerLevel = BaseEnums.LoggerLevel.INFO,
|
194
|
+
google_cloud_logging:Optional[GoogleCloudLogging] = None
|
195
|
+
) -> None:
|
196
|
+
"""Initialize client logger if not already initialized."""
|
197
|
+
if cls._logger is None:
|
198
|
+
cls.logger = ClientLogger(logs_dir=logs_dir, client_key=client_key, service_key=service_key, level=level, google_cloud_logging=google_cloud_logging)
|
199
|
+
|
200
|
+
@classmethod
|
201
|
+
def get(cls) -> ClientLogger:
|
202
|
+
"""Return client logger (if exist) or raise Runtime Error"""
|
203
|
+
if cls._logger is None:
|
204
|
+
raise RuntimeError("Logger has not been initialized. Initialize it first.")
|
205
|
+
return cls._logger
|
File without changes
|
File without changes
|
File without changes
|
{maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/clients/general/__init__.py
RENAMED
File without changes
|
{maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/clients/general/http.py
RENAMED
File without changes
|
{maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/clients/google/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/clients/google/cloud/base.py
RENAMED
File without changes
|
{maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/clients/google/cloud/logging.py
RENAMED
File without changes
|
{maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/clients/google/cloud/secret.py
RENAMED
File without changes
|
{maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/clients/google/cloud/storage.py
RENAMED
File without changes
|
{maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/clients/google/secret.py
RENAMED
File without changes
|
{maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/clients/google/storage.py
RENAMED
File without changes
|
{maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/clients/utils/__init__.py
RENAMED
File without changes
|
{maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/clients/utils/logger.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/expanded_types/__init__.py
RENAMED
File without changes
|
{maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/expanded_types/client.py
RENAMED
File without changes
|
{maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/expanded_types/general.py
RENAMED
File without changes
|
{maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/expanded_types/query.py
RENAMED
File without changes
|
{maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/expanded_types/service.py
RENAMED
File without changes
|
{maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/expanded_types/token.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/managers/client/__init__.py
RENAMED
File without changes
|
{maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/managers/client/base.py
RENAMED
File without changes
|
File without changes
|
{maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/managers/client/google/base.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/managers/client/http.py
RENAMED
File without changes
|
File without changes
|
{maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/middlewares/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/models/schemas/__init__.py
RENAMED
File without changes
|
{maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/models/schemas/general.py
RENAMED
File without changes
|
{maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/models/schemas/parameter.py
RENAMED
File without changes
|
{maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/models/schemas/result.py
RENAMED
File without changes
|
{maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/models/schemas/token.py
RENAMED
File without changes
|
{maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/models/transfers/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/utils/formatter/__init__.py
RENAMED
File without changes
|
{maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation/utils/formatter/case.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{maleo_foundation-0.0.100 → maleo_foundation-0.1.1}/maleo_foundation.egg-info/dependency_links.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|