orionis 0.78.0__py3-none-any.whl → 0.80.0__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.
- orionis/framework.py +1 -1
- orionis/luminate/app.py +11 -3
- orionis/luminate/config/logging.py +6 -6
- orionis/luminate/services/log/log_service.py +19 -30
- {orionis-0.78.0.dist-info → orionis-0.80.0.dist-info}/METADATA +1 -1
- {orionis-0.78.0.dist-info → orionis-0.80.0.dist-info}/RECORD +10 -10
- {orionis-0.78.0.dist-info → orionis-0.80.0.dist-info}/LICENCE +0 -0
- {orionis-0.78.0.dist-info → orionis-0.80.0.dist-info}/WHEEL +0 -0
- {orionis-0.78.0.dist-info → orionis-0.80.0.dist-info}/entry_points.txt +0 -0
- {orionis-0.78.0.dist-info → orionis-0.80.0.dist-info}/top_level.txt +0 -0
orionis/framework.py
CHANGED
orionis/luminate/app.py
CHANGED
@@ -5,7 +5,8 @@ from orionis.luminate.bootstrap.environment_bootstrapper import EnvironmentBoots
|
|
5
5
|
from orionis.luminate.patterns.singleton import SingletonMeta
|
6
6
|
from orionis.luminate.providers.environment.environment__service_provider import EnvironmentServiceProvider
|
7
7
|
from orionis.luminate.providers.config.config_service_provider import ConfigServiceProvider
|
8
|
-
from orionis.luminate.
|
8
|
+
from orionis.luminate.providers.log.log_service_provider import LogServiceProvider
|
9
|
+
from orionis.luminate.facades.log.log_facade import Log
|
9
10
|
|
10
11
|
class Application(metaclass=SingletonMeta):
|
11
12
|
|
@@ -67,5 +68,12 @@ class Application(metaclass=SingletonMeta):
|
|
67
68
|
|
68
69
|
# Cargar el proveedor de configuracion
|
69
70
|
_environment_provider = ConfigServiceProvider(app=self.container)
|
70
|
-
_environment_provider.register(
|
71
|
-
_environment_provider.boot()
|
71
|
+
_environment_provider.register()
|
72
|
+
_environment_provider.boot()
|
73
|
+
|
74
|
+
# Cargar el proveedor de log
|
75
|
+
_log_provider = LogServiceProvider(app=self.container)
|
76
|
+
_log_provider.register()
|
77
|
+
_log_provider.boot()
|
78
|
+
|
79
|
+
Log.info('Application is ready to run')
|
@@ -139,12 +139,12 @@ class Channels:
|
|
139
139
|
chunked : Chunked
|
140
140
|
Configuration for chunked log file storage.
|
141
141
|
"""
|
142
|
-
stack
|
143
|
-
hourly
|
144
|
-
daily
|
145
|
-
weekly
|
146
|
-
monthly
|
147
|
-
chunked
|
142
|
+
stack : Stack
|
143
|
+
hourly : Hourly
|
144
|
+
daily : Daily
|
145
|
+
weekly : Weekly
|
146
|
+
monthly : Monthly
|
147
|
+
chunked : Chunked
|
148
148
|
|
149
149
|
|
150
150
|
@dataclass
|
@@ -49,19 +49,6 @@ class LogguerService(ILogguerService):
|
|
49
49
|
self.config_service = config_service
|
50
50
|
self._initialize_logger()
|
51
51
|
|
52
|
-
def _path_resolver(self, filename: str):
|
53
|
-
"""
|
54
|
-
Resolves the log file path based on the specified filename.
|
55
|
-
"""
|
56
|
-
base_path = Path(os.getcwd())
|
57
|
-
log_dir = base_path / "storage" / "logs"
|
58
|
-
|
59
|
-
# Create the log directory if it does not exist
|
60
|
-
if not log_dir.exists():
|
61
|
-
log_dir.mkdir(parents=True, exist_ok=True)
|
62
|
-
|
63
|
-
return log_dir / filename
|
64
|
-
|
65
52
|
def _initialize_logger(self):
|
66
53
|
"""
|
67
54
|
Configures the logger with the specified settings.
|
@@ -82,6 +69,8 @@ class LogguerService(ILogguerService):
|
|
82
69
|
"""
|
83
70
|
try:
|
84
71
|
|
72
|
+
handlers = []
|
73
|
+
|
85
74
|
channel : str = self.config_service.get("logging.default")
|
86
75
|
config : dict = self.config_service.get(f"logging.channels.{channel}", {})
|
87
76
|
path : str = config.get("path", 'logs/orionis.log')
|
@@ -91,7 +80,7 @@ class LogguerService(ILogguerService):
|
|
91
80
|
|
92
81
|
handlers = [
|
93
82
|
logging.FileHandler(
|
94
|
-
filename=
|
83
|
+
filename=path,
|
95
84
|
encoding="utf-8"
|
96
85
|
)
|
97
86
|
]
|
@@ -100,7 +89,7 @@ class LogguerService(ILogguerService):
|
|
100
89
|
|
101
90
|
handlers = [
|
102
91
|
TimedRotatingFileHandler(
|
103
|
-
filename=
|
92
|
+
filename=path,
|
104
93
|
when="h",
|
105
94
|
interval=1,
|
106
95
|
backupCount=config.get('retention_hours', 24),
|
@@ -111,16 +100,16 @@ class LogguerService(ILogguerService):
|
|
111
100
|
|
112
101
|
elif channel == "daily":
|
113
102
|
|
114
|
-
backup_count
|
115
|
-
hour_at
|
116
|
-
if backup_count < 1
|
103
|
+
backup_count = config.get('retention_days', 30)
|
104
|
+
hour_at:str = config.get('at', "00:00")
|
105
|
+
if backup_count < 1:
|
117
106
|
raise ValueError("The 'retention_days' value must be an integer greater than 0.")
|
118
107
|
if not bool(re.match(r"^(?:[01]?\d|2[0-3]):[0-5]?\d$", hour_at)):
|
119
108
|
raise ValueError("The 'at' value must be a valid time in the format HH:MM.")
|
120
109
|
|
121
110
|
handlers = [
|
122
111
|
TimedRotatingFileHandler(
|
123
|
-
filename=
|
112
|
+
filename=path,
|
124
113
|
when="d",
|
125
114
|
interval=1,
|
126
115
|
backupCount=backup_count,
|
@@ -132,12 +121,12 @@ class LogguerService(ILogguerService):
|
|
132
121
|
|
133
122
|
elif channel == "weekly":
|
134
123
|
|
135
|
-
backup_count
|
136
|
-
if backup_count < 1
|
124
|
+
backup_count = config.get('retention_weeks', 4)
|
125
|
+
if backup_count < 1:
|
137
126
|
raise ValueError("The 'retention_weeks' value must be an integer greater than 0.")
|
138
127
|
handlers = [
|
139
128
|
TimedRotatingFileHandler(
|
140
|
-
filename=
|
129
|
+
filename=path,
|
141
130
|
when="w0",
|
142
131
|
interval=1,
|
143
132
|
backupCount=backup_count,
|
@@ -148,12 +137,12 @@ class LogguerService(ILogguerService):
|
|
148
137
|
|
149
138
|
elif channel == "monthly":
|
150
139
|
|
151
|
-
backup_count
|
152
|
-
if backup_count < 1
|
140
|
+
backup_count = config.get('retention_months', 2)
|
141
|
+
if backup_count < 1:
|
153
142
|
raise ValueError("The 'retention_months' value must be an integer greater than 0.")
|
154
143
|
handlers = [
|
155
144
|
TimedRotatingFileHandler(
|
156
|
-
filename=
|
145
|
+
filename=path,
|
157
146
|
when="midnight",
|
158
147
|
interval=30,
|
159
148
|
backupCount=backup_count,
|
@@ -164,15 +153,15 @@ class LogguerService(ILogguerService):
|
|
164
153
|
|
165
154
|
elif channel == "chunked":
|
166
155
|
|
167
|
-
max_bytes
|
168
|
-
if max_bytes < 1
|
156
|
+
max_bytes = config.get('mb_size', 5)
|
157
|
+
if max_bytes < 1:
|
169
158
|
raise ValueError("The 'mb_size' value must be an integer greater than 0.")
|
170
|
-
backup_count
|
171
|
-
if backup_count < 1
|
159
|
+
backup_count = config.get('max_files', 5)
|
160
|
+
if backup_count < 1:
|
172
161
|
raise ValueError("The 'max_files' value must be an integer greater than 0.")
|
173
162
|
handlers = [
|
174
163
|
RotatingFileHandler(
|
175
|
-
filename=
|
164
|
+
filename=path,
|
176
165
|
maxBytes= max_bytes * 1024 * 1024,
|
177
166
|
backupCount=backup_count,
|
178
167
|
encoding="utf-8"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
orionis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
2
|
orionis/cli_manager.py,sha256=0bM-hABXJSoPGuvEgnqeaj9qcLP8VjTQ3z9Mb0TSEUI,1381
|
3
|
-
orionis/framework.py,sha256=
|
3
|
+
orionis/framework.py,sha256=I1IFU4kjM_IdHGzyYiW4hp7PtIDRKZUsxIFUhdGsE4k,1386
|
4
4
|
orionis/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
5
|
orionis/contracts/bootstrap/i_command_bootstrapper.py,sha256=cfpYWSlNhOY1q_C9o0H7F381OoM0Oh0qaeqP-c85nzk,2457
|
6
6
|
orionis/contracts/bootstrap/i_config_bootstrapper.py,sha256=d2TXT74H2fCBbzWgrt9-ZG11S_H_YPQOEcJoIOrsgb0,4462
|
@@ -56,7 +56,7 @@ orionis/installer/installer_manager.py,sha256=Hb6T0bmSl39T30maY-nUWkrLhG77JdrKe4
|
|
56
56
|
orionis/installer/installer_output.py,sha256=LeKxzuXpnHOKbKpUtx3tMGkCi2bGcPV1VNnfBxwfxUU,7161
|
57
57
|
orionis/installer/installer_setup.py,sha256=c2HtVklSa-2_-YVonc7fwtoK-RTDqBS2Ybvbekgfqtc,6970
|
58
58
|
orionis/luminate/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
59
|
-
orionis/luminate/app.py,sha256
|
59
|
+
orionis/luminate/app.py,sha256=-s56Fvnsd5KZxwLZI2dNDI3ZuHcNpZU5Wq0XCzT1gJE,3484
|
60
60
|
orionis/luminate/app_context.py,sha256=XREVkOHU6aP8UB2daA2QbFcOCB8HRmcGXjVbrlW1AHQ,1827
|
61
61
|
orionis/luminate/bootstrap/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
62
62
|
orionis/luminate/bootstrap/command_bootstrapper.py,sha256=OU0hDMtG1xqVbvCneq4C5mlOUu9OmfkxqbvGH59QsUw,6919
|
@@ -71,7 +71,7 @@ orionis/luminate/config/cache.py,sha256=nBKmDFDb91sbBriEsVLjMhrNb__j7YsRzZGQRDdA
|
|
71
71
|
orionis/luminate/config/cors.py,sha256=zWKUylPiaUzGXTJM3eLmwY0HcAD7iOLp9QiAoTyAL08,2275
|
72
72
|
orionis/luminate/config/database.py,sha256=oj-FQWtbwIYrJAQktSGBl96EZu78fr6IBcQxHbWDVBM,5619
|
73
73
|
orionis/luminate/config/filesystems.py,sha256=fAn4Wx6naIb8E4U2TXJhVnx0Ipxpxc_Ee2w_FWfwlHI,2444
|
74
|
-
orionis/luminate/config/logging.py,sha256=
|
74
|
+
orionis/luminate/config/logging.py,sha256=s3QTCZtshRuMdWWpEKuM2Z-gT9Lf29Or7o_mJKfU8Ig,4047
|
75
75
|
orionis/luminate/config/mail.py,sha256=3iYXG72bXiVns4sEPZ_A3-cGcFjGEGDXkuLKkk-hKtY,2102
|
76
76
|
orionis/luminate/config/queue.py,sha256=DYjP5zD09ISsIX117wtOfjiG_iQrcrPoQVeeftmuO3c,1739
|
77
77
|
orionis/luminate/config/session.py,sha256=7mOC_DfGIBDqAClSiewHoTA9Kht_zdHApvALcZc7cfY,1861
|
@@ -132,7 +132,7 @@ orionis/luminate/services/environment/environment_service.py,sha256=IgrfzLELNhnE
|
|
132
132
|
orionis/luminate/services/files/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
133
133
|
orionis/luminate/services/files/path_resolver_service.py,sha256=E-G_E2H5QAZyxeMssARp7l1OBSxQurxkUPoKdSOCKEE,2041
|
134
134
|
orionis/luminate/services/log/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
135
|
-
orionis/luminate/services/log/log_service.py,sha256=
|
135
|
+
orionis/luminate/services/log/log_service.py,sha256=gYbjDV4Lh2f4qFbDItWtZ68pywTITyNkLyv2jyzbZz0,8130
|
136
136
|
orionis/luminate/support/dot_dict.py,sha256=FVHfBuAGTTVMjNG01Fix645fRNKKUMmNx61pYkxPL5c,1253
|
137
137
|
orionis/luminate/support/exception_to_dict.py,sha256=jpQ-c7ud1JLm8dTWbvMT1dI-rL3yTB2P8VxNscAX71k,2098
|
138
138
|
orionis/luminate/support/reflection.py,sha256=VYpluTQJ0W_m6jYQ9_L02sYFrk2wlLYtLY2yp9rZMKA,11944
|
@@ -153,9 +153,9 @@ tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
153
153
|
tests/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
154
154
|
tests/tools/class_example.py,sha256=dIPD997Y15n6WmKhWoOFSwEldRm9MdOHTZZ49eF1p3c,1056
|
155
155
|
tests/tools/test_reflection.py,sha256=bhLQ7VGVod4B8sv-rW9AjnOumvaBVsoxieA3sdoM2yM,5244
|
156
|
-
orionis-0.
|
157
|
-
orionis-0.
|
158
|
-
orionis-0.
|
159
|
-
orionis-0.
|
160
|
-
orionis-0.
|
161
|
-
orionis-0.
|
156
|
+
orionis-0.80.0.dist-info/LICENCE,sha256=-_4cF2EBKuYVS_SQpy1uapq0oJPUU1vl_RUWSy2jJTo,1111
|
157
|
+
orionis-0.80.0.dist-info/METADATA,sha256=OG3pCfV-jo1_4JcCHxnqCVbbCzccudkBjAr-FqoOmyQ,2978
|
158
|
+
orionis-0.80.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
159
|
+
orionis-0.80.0.dist-info/entry_points.txt,sha256=eef1_CVewfokKjrGBynXa06KabSJYo7LlDKKIKvs1cM,53
|
160
|
+
orionis-0.80.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
|
161
|
+
orionis-0.80.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|