prismalog 0.1.1__py3-none-any.whl → 0.1.3__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.
- prismalog/config.py +10 -1
- prismalog/log.py +6 -6
- {prismalog-0.1.1.dist-info → prismalog-0.1.3.dist-info}/METADATA +1 -1
- prismalog-0.1.3.dist-info/RECORD +10 -0
- {prismalog-0.1.1.dist-info → prismalog-0.1.3.dist-info}/WHEEL +1 -1
- prismalog-0.1.1.dist-info/RECORD +0 -10
- {prismalog-0.1.1.dist-info → prismalog-0.1.3.dist-info}/licenses/LICENSE +0 -0
- {prismalog-0.1.1.dist-info → prismalog-0.1.3.dist-info}/top_level.txt +0 -0
prismalog/config.py
CHANGED
@@ -132,7 +132,7 @@ class LoggingConfig:
|
|
132
132
|
}
|
133
133
|
|
134
134
|
_instance = None
|
135
|
-
_config: Dict[str, Any] = {}
|
135
|
+
_config: Dict[str, Any] = {}
|
136
136
|
_initialized = False
|
137
137
|
_debug_mode = False
|
138
138
|
|
@@ -162,6 +162,7 @@ class LoggingConfig:
|
|
162
162
|
The configuration is loaded in two phases:
|
163
163
|
1. Collection Phase: Gather and convert configurations from all sources
|
164
164
|
2. Application Phase: Apply configurations in priority order
|
165
|
+
3. Finalization Phase: Set the initialized flag
|
165
166
|
|
166
167
|
Args:
|
167
168
|
config_file: Path to configuration file (YAML)
|
@@ -187,6 +188,9 @@ class LoggingConfig:
|
|
187
188
|
# Phase 2: Apply configurations in priority order
|
188
189
|
cls._apply_configurations(config_sources)
|
189
190
|
|
191
|
+
# Phase 3: Set initialized flag
|
192
|
+
cls._initialized = True
|
193
|
+
|
190
194
|
return cls._config
|
191
195
|
|
192
196
|
@classmethod
|
@@ -792,6 +796,11 @@ class LoggingConfig:
|
|
792
796
|
"CRITICAL": logging.CRITICAL,
|
793
797
|
}.get(level, logging.INFO)
|
794
798
|
|
799
|
+
@classmethod
|
800
|
+
def is_initialized(cls) -> bool:
|
801
|
+
"""Check if logging configuration has been initialized."""
|
802
|
+
return cls._initialized
|
803
|
+
|
795
804
|
@classmethod
|
796
805
|
def reset(cls) -> Type["LoggingConfig"]:
|
797
806
|
"""
|
prismalog/log.py
CHANGED
@@ -688,11 +688,11 @@ class ColoredLogger:
|
|
688
688
|
|
689
689
|
def debug(self, msg: str, *args: Any, **kwargs: Any) -> None:
|
690
690
|
"""Logs a debug message."""
|
691
|
-
self.logger.debug(msg, *args, **kwargs)
|
691
|
+
self.logger.debug(msg, *args, **kwargs, stacklevel=2)
|
692
692
|
|
693
693
|
def info(self, msg: str, *args: Any, **kwargs: Any) -> None:
|
694
694
|
"""Logs an info message."""
|
695
|
-
self.logger.info(msg, *args, **kwargs)
|
695
|
+
self.logger.info(msg, *args, **kwargs, stacklevel=2)
|
696
696
|
|
697
697
|
def warning(self, msg: str, *args: Any, **kwargs: Any) -> None:
|
698
698
|
"""
|
@@ -703,7 +703,7 @@ class ColoredLogger:
|
|
703
703
|
*args: Variable length argument list
|
704
704
|
**kwargs: Arbitrary keyword arguments
|
705
705
|
"""
|
706
|
-
self.logger.warning(msg, *args, **kwargs)
|
706
|
+
self.logger.warning(msg, *args, **kwargs, stacklevel=2)
|
707
707
|
|
708
708
|
def error(self, msg: str, *args: Any, **kwargs: Any) -> None:
|
709
709
|
"""
|
@@ -714,7 +714,7 @@ class ColoredLogger:
|
|
714
714
|
*args: Variable length argument list
|
715
715
|
**kwargs: Arbitrary keyword arguments
|
716
716
|
"""
|
717
|
-
self.logger.error(msg, *args, **kwargs)
|
717
|
+
self.logger.error(msg, *args, **kwargs, stacklevel=2)
|
718
718
|
|
719
719
|
def critical(self, msg: str, *args: Any, **kwargs: Any) -> None:
|
720
720
|
"""
|
@@ -727,11 +727,11 @@ class ColoredLogger:
|
|
727
727
|
*args: Variable length argument list
|
728
728
|
**kwargs: Arbitrary keyword arguments
|
729
729
|
"""
|
730
|
-
self.logger.critical(msg, *args, **kwargs)
|
730
|
+
self.logger.critical(msg, *args, **kwargs, stacklevel=2)
|
731
731
|
|
732
732
|
def exception(self, msg: str, *args: Any, **kwargs: Any) -> None:
|
733
733
|
"""Logs an exception message."""
|
734
|
-
self.logger.exception(msg, *args, **kwargs)
|
734
|
+
self.logger.exception(msg, *args, **kwargs, stacklevel=2)
|
735
735
|
|
736
736
|
|
737
737
|
_EXTERNAL_LOGGERS_CONFIGURED = False
|
@@ -0,0 +1,10 @@
|
|
1
|
+
prismalog/__init__.py,sha256=Hr3ZNOGJLb8YvDTxViYuNUOKTlKridjFVmubnoCk1c4,998
|
2
|
+
prismalog/argparser.py,sha256=p5sXHKyACYA2JBLoxT4pcfNvI_R5exUgyx6x9d6RYqw,7648
|
3
|
+
prismalog/config.py,sha256=U-vBxQNRdlJaLxD8Z1ww4JJzzn_U2m7Q9X5DvzEYzow,32284
|
4
|
+
prismalog/log.py,sha256=hdl2syPBXO7zZYltcFlXJQlcdxY7YkBgZ2OdoNHOspE,35546
|
5
|
+
prismalog/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
|
+
prismalog-0.1.3.dist-info/licenses/LICENSE,sha256=A1PgraGM1LCUsPVtfZk1lOVRM1TrxvGqfleCPm0hKKk,1071
|
7
|
+
prismalog-0.1.3.dist-info/METADATA,sha256=n0PoC4ScKqw7h4rByx_3uq7o9nNadOghWAwXNvTKY_E,7725
|
8
|
+
prismalog-0.1.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
9
|
+
prismalog-0.1.3.dist-info/top_level.txt,sha256=k65xN7XJxN3Z3UOJTQpDUkQnmRDv763tkgVneLrEesU,10
|
10
|
+
prismalog-0.1.3.dist-info/RECORD,,
|
prismalog-0.1.1.dist-info/RECORD
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
prismalog/__init__.py,sha256=Hr3ZNOGJLb8YvDTxViYuNUOKTlKridjFVmubnoCk1c4,998
|
2
|
-
prismalog/argparser.py,sha256=p5sXHKyACYA2JBLoxT4pcfNvI_R5exUgyx6x9d6RYqw,7648
|
3
|
-
prismalog/config.py,sha256=3pUeLoQgZitIa_5h0CP-By7CZrkvHZvw4r5wpUfaSz8,32024
|
4
|
-
prismalog/log.py,sha256=hkLmMrlX1Ym9_l3L2cAHt-JnJtJpnrEpbvlykr6Rwqg,35462
|
5
|
-
prismalog/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
|
-
prismalog-0.1.1.dist-info/licenses/LICENSE,sha256=A1PgraGM1LCUsPVtfZk1lOVRM1TrxvGqfleCPm0hKKk,1071
|
7
|
-
prismalog-0.1.1.dist-info/METADATA,sha256=5TkAlAuIOjNFUmmDZGIaIEqH44ZtKyqYhlSK6kQR23k,7725
|
8
|
-
prismalog-0.1.1.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
|
9
|
-
prismalog-0.1.1.dist-info/top_level.txt,sha256=k65xN7XJxN3Z3UOJTQpDUkQnmRDv763tkgVneLrEesU,10
|
10
|
-
prismalog-0.1.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|