orionis 0.77.0__tar.gz → 0.80.0__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.
- {orionis-0.77.0/orionis.egg-info → orionis-0.80.0}/PKG-INFO +1 -1
- {orionis-0.77.0 → orionis-0.80.0}/orionis/framework.py +1 -1
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/app.py +11 -3
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/config/logging.py +74 -18
- orionis-0.80.0/orionis/luminate/services/log/log_service.py +240 -0
- {orionis-0.77.0 → orionis-0.80.0/orionis.egg-info}/PKG-INFO +1 -1
- orionis-0.77.0/orionis/luminate/services/log/log_service.py +0 -159
- {orionis-0.77.0 → orionis-0.80.0}/LICENCE +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/MANIFEST.in +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/README.md +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/cli_manager.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/bootstrap/i_command_bootstrapper.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/bootstrap/i_config_bootstrapper.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/bootstrap/i_environment_bootstrapper.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/config/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/config/i_config.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/console/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/console/base/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/console/base/i_command.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/console/i_command_filter.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/console/i_kernel.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/console/i_parser.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/console/i_task_manager.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/console/output/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/console/output/i_console.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/console/output/i_executor.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/console/output/i_progress_bar.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/console/tasks/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/console/tasks/i_schedule.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/container/i_container.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/container/i_types.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/facades/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/facades/config/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/facades/config/i_config_facade.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/facades/environment/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/facades/environment/i_environment_facade.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/facades/files/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/facades/files/i_path_facade.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/facades/log/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/facades/log/i_log_facade.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/facades/tests/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/facades/tests/i_tests_facade.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/installer/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/installer/i_installer_manager.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/installer/i_installer_output.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/installer/i_installer_setup.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/providers/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/providers/i_service_provider.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/services/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/services/config/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/services/config/i_config_service.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/services/environment/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/services/environment/i_environment_service.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/services/files/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/services/files/i_path_resolver_service.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/services/log/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/services/log/i_log_service.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/support/i_exception_to_dict.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/support/i_reflection.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/support/i_std.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/installer/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/installer/installer_manager.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/installer/installer_output.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/installer/installer_setup.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/app_context.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/bootstrap/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/bootstrap/command_bootstrapper.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/bootstrap/config_bootstrapper.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/bootstrap/environment_bootstrapper.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/bootstrap/exception_bootstrapper.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/bootstrap/service_providers_bootstrapper.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/config/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/config/app.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/config/auth.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/config/cache.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/config/cors.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/config/database.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/config/filesystems.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/config/mail.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/config/queue.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/config/session.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/console/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/console/base/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/console/base/command.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/console/command_filter.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/console/commands/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/console/commands/cache_clear.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/console/commands/help.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/console/commands/schedule_work.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/console/commands/tests.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/console/commands/version.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/console/exceptions/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/console/exceptions/cli_exception.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/console/kernel.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/console/output/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/console/output/console.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/console/output/executor.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/console/output/progress_bar.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/console/output/styles.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/console/parser.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/console/runner.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/console/tasks/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/console/tasks/scheduler.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/container/container.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/container/exception.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/container/types.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/facades/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/facades/app.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/facades/config/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/facades/config/config_facade.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/facades/environment/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/facades/environment/environment_facade.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/facades/files/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/facades/files/path_facade.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/facades/log/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/facades/log/log_facade.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/facades/tests/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/facades/tests/tests_facade.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/patterns/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/patterns/singleton.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/pipelines/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/pipelines/cli_pipeline.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/providers/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/providers/config/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/providers/config/config_service_provider.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/providers/environment/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/providers/environment/environment__service_provider.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/providers/log/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/providers/log/log_service_provider.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/providers/service_provider.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/services/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/services/config/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/services/config/config_service.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/services/environment/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/services/environment/environment_service.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/services/files/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/services/files/path_resolver_service.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/services/log/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/support/dot_dict.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/support/exception_to_dict.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/support/reflection.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/support/std.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/test/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/test/exception.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/test/unit_test.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/static/ascii/icon.ascii +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/static/ascii/info.ascii +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/static/bg/galaxy.jpg +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/static/favicon/OrionisFrameworkFavicon.png +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/static/logos/OrionisFramework.jpg +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/static/logos/OrionisFramework.png +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/static/logos/OrionisFramework.psd +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/static/logos/OrionisFramework2.png +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis/static/logos/OrionisFramework3.png +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis.egg-info/SOURCES.txt +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis.egg-info/dependency_links.txt +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis.egg-info/entry_points.txt +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis.egg-info/requires.txt +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/orionis.egg-info/top_level.txt +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/setup.cfg +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/setup.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/tests/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/tests/tools/__init__.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/tests/tools/class_example.py +0 -0
- {orionis-0.77.0 → orionis-0.80.0}/tests/tools/test_reflection.py +0 -0
@@ -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')
|
@@ -1,8 +1,9 @@
|
|
1
1
|
from dataclasses import dataclass, field
|
2
|
-
from
|
2
|
+
from datetime import time
|
3
|
+
from typing import Dict, Union
|
3
4
|
|
4
5
|
@dataclass
|
5
|
-
class
|
6
|
+
class Stack:
|
6
7
|
"""
|
7
8
|
Represents a single log file configuration.
|
8
9
|
|
@@ -17,7 +18,25 @@ class Single:
|
|
17
18
|
"""
|
18
19
|
path: str
|
19
20
|
level: str
|
20
|
-
|
21
|
+
|
22
|
+
|
23
|
+
@dataclass
|
24
|
+
class Hourly:
|
25
|
+
"""
|
26
|
+
Represents an hourly log file rotation configuration.
|
27
|
+
|
28
|
+
Attributes
|
29
|
+
----------
|
30
|
+
path : str
|
31
|
+
The file path where hourly logs are stored.
|
32
|
+
level : str
|
33
|
+
The logging level (e.g., 'info', 'error', 'debug').
|
34
|
+
retention_hours : int
|
35
|
+
The number of hours to retain log files before deletion.
|
36
|
+
"""
|
37
|
+
path: str
|
38
|
+
level: str
|
39
|
+
retention_hours: int
|
21
40
|
|
22
41
|
|
23
42
|
@dataclass
|
@@ -31,15 +50,53 @@ class Daily:
|
|
31
50
|
The file path where daily logs are stored.
|
32
51
|
level : str
|
33
52
|
The logging level (e.g., 'info', 'error', 'debug').
|
34
|
-
|
53
|
+
retention_days : int
|
35
54
|
The number of days to retain log files before deletion.
|
36
|
-
|
37
|
-
|
55
|
+
at_time : time
|
56
|
+
The time of day when the log rotation should occur.
|
57
|
+
"""
|
58
|
+
path: str
|
59
|
+
level: str
|
60
|
+
retention_days: int
|
61
|
+
at: time
|
62
|
+
|
63
|
+
|
64
|
+
@dataclass
|
65
|
+
class Weekly:
|
66
|
+
"""
|
67
|
+
Represents a weekly log file rotation configuration.
|
68
|
+
|
69
|
+
Attributes
|
70
|
+
----------
|
71
|
+
path : str
|
72
|
+
The file path where weekly logs are stored.
|
73
|
+
level : str
|
74
|
+
The logging level (e.g., 'info', 'error', 'debug').
|
75
|
+
retention_weeks : int
|
76
|
+
The number of weeks to retain log files before deletion.
|
38
77
|
"""
|
39
78
|
path: str
|
40
79
|
level: str
|
41
|
-
|
42
|
-
|
80
|
+
retention_weeks: int
|
81
|
+
|
82
|
+
|
83
|
+
@dataclass
|
84
|
+
class Monthly:
|
85
|
+
"""
|
86
|
+
Represents a monthly log file rotation configuration.
|
87
|
+
|
88
|
+
Attributes
|
89
|
+
----------
|
90
|
+
path : str
|
91
|
+
The file path where monthly logs are stored.
|
92
|
+
level : str
|
93
|
+
The logging level (e.g., 'info', 'error', 'debug').
|
94
|
+
retention_months : int
|
95
|
+
The number of months to retain log files before deletion.
|
96
|
+
"""
|
97
|
+
path: str
|
98
|
+
level: str
|
99
|
+
retention_months: int
|
43
100
|
|
44
101
|
|
45
102
|
@dataclass
|
@@ -56,20 +113,16 @@ class Chunked:
|
|
56
113
|
The file path where chunked logs are stored.
|
57
114
|
level : str
|
58
115
|
The logging level (e.g., 'info', 'error', 'debug').
|
59
|
-
|
116
|
+
max_mb_size : Union[int, str]
|
60
117
|
The maximum file size before creating a new chunk.
|
61
118
|
Can be an integer (bytes) or a string (e.g., '10MB', '500KB').
|
62
119
|
max_files : int
|
63
120
|
The maximum number of log files to retain before older files are deleted.
|
64
|
-
stream : bool
|
65
|
-
Whether to output logs to the console.
|
66
121
|
"""
|
67
|
-
|
68
122
|
path: str
|
69
123
|
level: str
|
70
|
-
|
71
|
-
|
72
|
-
stream: bool
|
124
|
+
mb_size: Union[int, str]
|
125
|
+
files: int
|
73
126
|
|
74
127
|
|
75
128
|
@dataclass
|
@@ -86,9 +139,12 @@ class Channels:
|
|
86
139
|
chunked : Chunked
|
87
140
|
Configuration for chunked log file storage.
|
88
141
|
"""
|
89
|
-
|
90
|
-
|
91
|
-
|
142
|
+
stack : Stack
|
143
|
+
hourly : Hourly
|
144
|
+
daily : Daily
|
145
|
+
weekly : Weekly
|
146
|
+
monthly : Monthly
|
147
|
+
chunked : Chunked
|
92
148
|
|
93
149
|
|
94
150
|
@dataclass
|
@@ -0,0 +1,240 @@
|
|
1
|
+
import logging
|
2
|
+
import os
|
3
|
+
import re
|
4
|
+
from datetime import datetime
|
5
|
+
from logging.handlers import RotatingFileHandler, TimedRotatingFileHandler
|
6
|
+
from pathlib import Path
|
7
|
+
from orionis.contracts.services.log.i_log_service import ILogguerService
|
8
|
+
from orionis.luminate.services.config.config_service import ConfigService
|
9
|
+
|
10
|
+
class LogguerService(ILogguerService):
|
11
|
+
"""
|
12
|
+
A service class for logging messages with different severity levels.
|
13
|
+
|
14
|
+
This class initializes a logger that can write logs to a file. It supports
|
15
|
+
various log levels such as INFO, ERROR, SUCCESS, WARNING, and DEBUG.
|
16
|
+
|
17
|
+
Attributes
|
18
|
+
----------
|
19
|
+
logger : logging.Logger
|
20
|
+
The logger instance used to log messages.
|
21
|
+
|
22
|
+
Methods
|
23
|
+
-------
|
24
|
+
__init__(config_service: ConfigService)
|
25
|
+
Initializes the logger with ConfigService
|
26
|
+
_initialize_logger(config_service: ConfigService)
|
27
|
+
Configures the logger with ConfigService settings.
|
28
|
+
info(message: str) -> None
|
29
|
+
Logs an informational message.
|
30
|
+
error(message: str) -> None
|
31
|
+
Logs an error message.
|
32
|
+
success(message: str) -> None
|
33
|
+
Logs a success message (treated as info).
|
34
|
+
warning(message: str) -> None
|
35
|
+
Logs a warning message.
|
36
|
+
debug(message: str) -> None
|
37
|
+
Logs a debug message.
|
38
|
+
"""
|
39
|
+
|
40
|
+
def __init__(self, config_service : ConfigService):
|
41
|
+
"""
|
42
|
+
Initializes the logger with the specified path, log level, and filename.
|
43
|
+
|
44
|
+
Parameters
|
45
|
+
----------
|
46
|
+
config_service : ConfigService
|
47
|
+
The configuration service instance.
|
48
|
+
"""
|
49
|
+
self.config_service = config_service
|
50
|
+
self._initialize_logger()
|
51
|
+
|
52
|
+
def _initialize_logger(self):
|
53
|
+
"""
|
54
|
+
Configures the logger with the specified settings.
|
55
|
+
|
56
|
+
This method sets up the logger to write logs to a file. If the specified
|
57
|
+
directory does not exist, it creates it. The log format includes the
|
58
|
+
timestamp and the log message.
|
59
|
+
|
60
|
+
Parameters
|
61
|
+
----------
|
62
|
+
config_service : ConfigService
|
63
|
+
The configuration service instance.
|
64
|
+
|
65
|
+
Raises
|
66
|
+
------
|
67
|
+
RuntimeError
|
68
|
+
If the logger cannot be initialized due to an error.
|
69
|
+
"""
|
70
|
+
try:
|
71
|
+
|
72
|
+
handlers = []
|
73
|
+
|
74
|
+
channel : str = self.config_service.get("logging.default")
|
75
|
+
config : dict = self.config_service.get(f"logging.channels.{channel}", {})
|
76
|
+
path : str = config.get("path", 'logs/orionis.log')
|
77
|
+
app_timezone : str = self.config_service.get("app.timezone", "UTC")
|
78
|
+
|
79
|
+
if channel == "stack":
|
80
|
+
|
81
|
+
handlers = [
|
82
|
+
logging.FileHandler(
|
83
|
+
filename=path,
|
84
|
+
encoding="utf-8"
|
85
|
+
)
|
86
|
+
]
|
87
|
+
|
88
|
+
elif channel == "hourly":
|
89
|
+
|
90
|
+
handlers = [
|
91
|
+
TimedRotatingFileHandler(
|
92
|
+
filename=path,
|
93
|
+
when="h",
|
94
|
+
interval=1,
|
95
|
+
backupCount=config.get('retention_hours', 24),
|
96
|
+
encoding="utf-8",
|
97
|
+
utc= True if app_timezone == "UTC" else False
|
98
|
+
)
|
99
|
+
]
|
100
|
+
|
101
|
+
elif channel == "daily":
|
102
|
+
|
103
|
+
backup_count = config.get('retention_days', 30)
|
104
|
+
hour_at:str = config.get('at', "00:00")
|
105
|
+
if backup_count < 1:
|
106
|
+
raise ValueError("The 'retention_days' value must be an integer greater than 0.")
|
107
|
+
if not bool(re.match(r"^(?:[01]?\d|2[0-3]):[0-5]?\d$", hour_at)):
|
108
|
+
raise ValueError("The 'at' value must be a valid time in the format HH:MM.")
|
109
|
+
|
110
|
+
handlers = [
|
111
|
+
TimedRotatingFileHandler(
|
112
|
+
filename=path,
|
113
|
+
when="d",
|
114
|
+
interval=1,
|
115
|
+
backupCount=backup_count,
|
116
|
+
encoding="utf-8",
|
117
|
+
atTime=datetime.strptime(hour_at, "%H:%M").time(),
|
118
|
+
utc= True if app_timezone == "UTC" else False
|
119
|
+
)
|
120
|
+
]
|
121
|
+
|
122
|
+
elif channel == "weekly":
|
123
|
+
|
124
|
+
backup_count = config.get('retention_weeks', 4)
|
125
|
+
if backup_count < 1:
|
126
|
+
raise ValueError("The 'retention_weeks' value must be an integer greater than 0.")
|
127
|
+
handlers = [
|
128
|
+
TimedRotatingFileHandler(
|
129
|
+
filename=path,
|
130
|
+
when="w0",
|
131
|
+
interval=1,
|
132
|
+
backupCount=backup_count,
|
133
|
+
encoding="utf-8",
|
134
|
+
utc= True if app_timezone == "UTC" else False
|
135
|
+
)
|
136
|
+
]
|
137
|
+
|
138
|
+
elif channel == "monthly":
|
139
|
+
|
140
|
+
backup_count = config.get('retention_months', 2)
|
141
|
+
if backup_count < 1:
|
142
|
+
raise ValueError("The 'retention_months' value must be an integer greater than 0.")
|
143
|
+
handlers = [
|
144
|
+
TimedRotatingFileHandler(
|
145
|
+
filename=path,
|
146
|
+
when="midnight",
|
147
|
+
interval=30,
|
148
|
+
backupCount=backup_count,
|
149
|
+
encoding="utf-8",
|
150
|
+
utc= True if app_timezone == "UTC" else False
|
151
|
+
)
|
152
|
+
]
|
153
|
+
|
154
|
+
elif channel == "chunked":
|
155
|
+
|
156
|
+
max_bytes = config.get('mb_size', 5)
|
157
|
+
if max_bytes < 1:
|
158
|
+
raise ValueError("The 'mb_size' value must be an integer greater than 0.")
|
159
|
+
backup_count = config.get('max_files', 5)
|
160
|
+
if backup_count < 1:
|
161
|
+
raise ValueError("The 'max_files' value must be an integer greater than 0.")
|
162
|
+
handlers = [
|
163
|
+
RotatingFileHandler(
|
164
|
+
filename=path,
|
165
|
+
maxBytes= max_bytes * 1024 * 1024,
|
166
|
+
backupCount=backup_count,
|
167
|
+
encoding="utf-8"
|
168
|
+
)
|
169
|
+
]
|
170
|
+
|
171
|
+
|
172
|
+
# Configure the logger
|
173
|
+
logging.basicConfig(
|
174
|
+
level=config.get("level", "INFO").upper(),
|
175
|
+
format="%(asctime)s - %(message)s",
|
176
|
+
datefmt="%Y-%m-%d %H:%M:%S",
|
177
|
+
encoding="utf-8",
|
178
|
+
handlers=handlers
|
179
|
+
)
|
180
|
+
|
181
|
+
# Get the logger instance
|
182
|
+
self.logger = logging.getLogger(__name__)
|
183
|
+
|
184
|
+
except Exception as e:
|
185
|
+
raise RuntimeError(f"Failed to initialize logger: {e}")
|
186
|
+
|
187
|
+
def info(self, message: str) -> None:
|
188
|
+
"""
|
189
|
+
Logs an informational message.
|
190
|
+
|
191
|
+
Parameters
|
192
|
+
----------
|
193
|
+
message : str
|
194
|
+
The message to log.
|
195
|
+
"""
|
196
|
+
self.logger.info(f"[INFO] - {message}")
|
197
|
+
|
198
|
+
def error(self, message: str) -> None:
|
199
|
+
"""
|
200
|
+
Logs an error message.
|
201
|
+
|
202
|
+
Parameters
|
203
|
+
----------
|
204
|
+
message : str
|
205
|
+
The message to log.
|
206
|
+
"""
|
207
|
+
self.logger.error(f"[ERROR] - {message}")
|
208
|
+
|
209
|
+
def success(self, message: str) -> None:
|
210
|
+
"""
|
211
|
+
Logs a success message (treated as info).
|
212
|
+
|
213
|
+
Parameters
|
214
|
+
----------
|
215
|
+
message : str
|
216
|
+
The message to log.
|
217
|
+
"""
|
218
|
+
self.logger.info(f"[SUCCESS] - {message}")
|
219
|
+
|
220
|
+
def warning(self, message: str) -> None:
|
221
|
+
"""
|
222
|
+
Logs a warning message.
|
223
|
+
|
224
|
+
Parameters
|
225
|
+
----------
|
226
|
+
message : str
|
227
|
+
The message to log.
|
228
|
+
"""
|
229
|
+
self.logger.warning(f"[WARNING] - {message}")
|
230
|
+
|
231
|
+
def debug(self, message: str) -> None:
|
232
|
+
"""
|
233
|
+
Logs a debug message.
|
234
|
+
|
235
|
+
Parameters
|
236
|
+
----------
|
237
|
+
message : str
|
238
|
+
The message to log.
|
239
|
+
"""
|
240
|
+
self.logger.debug(f"[DEBUG] - {message}")
|
@@ -1,159 +0,0 @@
|
|
1
|
-
import os
|
2
|
-
import logging
|
3
|
-
from pathlib import Path
|
4
|
-
from typing import Optional
|
5
|
-
from orionis.contracts.services.log.i_log_service import ILogguerService
|
6
|
-
|
7
|
-
class LogguerService(ILogguerService):
|
8
|
-
"""
|
9
|
-
A service class for logging messages with different severity levels.
|
10
|
-
|
11
|
-
This class initializes a logger that can write logs to a file. It supports
|
12
|
-
various log levels such as INFO, ERROR, SUCCESS, WARNING, and DEBUG.
|
13
|
-
|
14
|
-
Attributes
|
15
|
-
----------
|
16
|
-
logger : logging.Logger
|
17
|
-
The logger instance used to log messages.
|
18
|
-
|
19
|
-
Methods
|
20
|
-
-------
|
21
|
-
__init__(path: Optional[str] = None, level: int = logging.INFO, filename: Optional[str] = 'orionis.log')
|
22
|
-
Initializes the logger with the specified path, log level, and filename.
|
23
|
-
_initialize_logger(path: Optional[str], level: int, filename: Optional[str] = 'orionis.log')
|
24
|
-
Configures the logger with the specified settings.
|
25
|
-
info(message: str) -> None
|
26
|
-
Logs an informational message.
|
27
|
-
error(message: str) -> None
|
28
|
-
Logs an error message.
|
29
|
-
success(message: str) -> None
|
30
|
-
Logs a success message (treated as info).
|
31
|
-
warning(message: str) -> None
|
32
|
-
Logs a warning message.
|
33
|
-
debug(message: str) -> None
|
34
|
-
Logs a debug message.
|
35
|
-
"""
|
36
|
-
|
37
|
-
def __init__(self, path: Optional[str] = None, level: int = logging.INFO, filename: Optional[str] = 'orionis.log'):
|
38
|
-
"""
|
39
|
-
Initializes the logger with the specified path, log level, and filename.
|
40
|
-
|
41
|
-
Parameters
|
42
|
-
----------
|
43
|
-
path : Optional[str]
|
44
|
-
The directory path where the log file will be stored. If not provided,
|
45
|
-
it defaults to a 'logs' directory inside the 'storage' folder of the
|
46
|
-
current working directory.
|
47
|
-
level : int
|
48
|
-
The logging level (e.g., logging.INFO, logging.ERROR). Defaults to logging.INFO.
|
49
|
-
filename : Optional[str]
|
50
|
-
The name of the log file. Defaults to 'orionis.log'.
|
51
|
-
"""
|
52
|
-
self._initialize_logger(path, level, filename)
|
53
|
-
|
54
|
-
def _initialize_logger(self, path: Optional[str], level: int, filename: Optional[str] = 'orionis.log'):
|
55
|
-
"""
|
56
|
-
Configures the logger with the specified settings.
|
57
|
-
|
58
|
-
This method sets up the logger to write logs to a file. If the specified
|
59
|
-
directory does not exist, it creates it. The log format includes the
|
60
|
-
timestamp and the log message.
|
61
|
-
|
62
|
-
Parameters
|
63
|
-
----------
|
64
|
-
path : Optional[str]
|
65
|
-
The directory path where the log file will be stored.
|
66
|
-
level : int
|
67
|
-
The logging level (e.g., logging.INFO, logging.ERROR).
|
68
|
-
filename : Optional[str]
|
69
|
-
The name of the log file.
|
70
|
-
|
71
|
-
Raises
|
72
|
-
------
|
73
|
-
RuntimeError
|
74
|
-
If the logger cannot be initialized due to an error.
|
75
|
-
"""
|
76
|
-
try:
|
77
|
-
# Resolve the log directory and file path
|
78
|
-
if path is None:
|
79
|
-
base_path = Path(os.getcwd())
|
80
|
-
log_dir = base_path / "storage" / "logs"
|
81
|
-
|
82
|
-
# Create the log directory if it does not exist
|
83
|
-
if not log_dir.exists():
|
84
|
-
log_dir.mkdir(parents=True, exist_ok=True)
|
85
|
-
|
86
|
-
path = log_dir / filename
|
87
|
-
|
88
|
-
# Configure the logger
|
89
|
-
logging.basicConfig(
|
90
|
-
level=level,
|
91
|
-
format="%(asctime)s - %(message)s",
|
92
|
-
datefmt="%Y-%m-%d %H:%M:%S",
|
93
|
-
encoding="utf-8",
|
94
|
-
handlers=[
|
95
|
-
logging.FileHandler(path, encoding="utf-8")
|
96
|
-
# logging.StreamHandler() # Uncomment to also log to the console
|
97
|
-
]
|
98
|
-
)
|
99
|
-
|
100
|
-
# Get the logger instance
|
101
|
-
self.logger = logging.getLogger(__name__)
|
102
|
-
|
103
|
-
except Exception as e:
|
104
|
-
raise RuntimeError(f"Failed to initialize logger: {e}")
|
105
|
-
|
106
|
-
def info(self, message: str) -> None:
|
107
|
-
"""
|
108
|
-
Logs an informational message.
|
109
|
-
|
110
|
-
Parameters
|
111
|
-
----------
|
112
|
-
message : str
|
113
|
-
The message to log.
|
114
|
-
"""
|
115
|
-
self.logger.info(f"[INFO] - {message}")
|
116
|
-
|
117
|
-
def error(self, message: str) -> None:
|
118
|
-
"""
|
119
|
-
Logs an error message.
|
120
|
-
|
121
|
-
Parameters
|
122
|
-
----------
|
123
|
-
message : str
|
124
|
-
The message to log.
|
125
|
-
"""
|
126
|
-
self.logger.error(f"[ERROR] - {message}")
|
127
|
-
|
128
|
-
def success(self, message: str) -> None:
|
129
|
-
"""
|
130
|
-
Logs a success message (treated as info).
|
131
|
-
|
132
|
-
Parameters
|
133
|
-
----------
|
134
|
-
message : str
|
135
|
-
The message to log.
|
136
|
-
"""
|
137
|
-
self.logger.info(f"[SUCCESS] - {message}")
|
138
|
-
|
139
|
-
def warning(self, message: str) -> None:
|
140
|
-
"""
|
141
|
-
Logs a warning message.
|
142
|
-
|
143
|
-
Parameters
|
144
|
-
----------
|
145
|
-
message : str
|
146
|
-
The message to log.
|
147
|
-
"""
|
148
|
-
self.logger.warning(f"[WARNING] - {message}")
|
149
|
-
|
150
|
-
def debug(self, message: str) -> None:
|
151
|
-
"""
|
152
|
-
Logs a debug message.
|
153
|
-
|
154
|
-
Parameters
|
155
|
-
----------
|
156
|
-
message : str
|
157
|
-
The message to log.
|
158
|
-
"""
|
159
|
-
self.logger.debug(f"[DEBUG] - {message}")
|
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/facades/environment/i_environment_facade.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
|
{orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/services/environment/i_environment_service.py
RENAMED
File without changes
|
File without changes
|
{orionis-0.77.0 → orionis-0.80.0}/orionis/contracts/services/files/i_path_resolver_service.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
|
{orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/bootstrap/service_providers_bootstrapper.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
|
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
|
{orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/facades/environment/environment_facade.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
|
{orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/providers/config/config_service_provider.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
|
{orionis-0.77.0 → orionis-0.80.0}/orionis/luminate/services/environment/environment_service.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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|