alt-python-logger 1.0.1__tar.gz → 1.1.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.
- {alt_python_logger-1.0.1 → alt_python_logger-1.1.0}/.gitignore +1 -0
- {alt_python_logger-1.0.1 → alt_python_logger-1.1.0}/PKG-INFO +1 -1
- {alt_python_logger-1.0.1 → alt_python_logger-1.1.0}/logger/__init__.py +2 -0
- alt_python_logger-1.1.0/logger/caching_logger_factory.py +34 -0
- {alt_python_logger-1.0.1 → alt_python_logger-1.1.0}/pyproject.toml +1 -1
- {alt_python_logger-1.0.1 → alt_python_logger-1.1.0}/README.md +0 -0
- {alt_python_logger-1.0.1 → alt_python_logger-1.1.0}/logger/caching_console.py +0 -0
- {alt_python_logger-1.0.1 → alt_python_logger-1.1.0}/logger/configurable_logger.py +0 -0
- {alt_python_logger-1.0.1 → alt_python_logger-1.1.0}/logger/console_logger.py +0 -0
- {alt_python_logger-1.0.1 → alt_python_logger-1.1.0}/logger/delegating_logger.py +0 -0
- {alt_python_logger-1.0.1 → alt_python_logger-1.1.0}/logger/json_formatter.py +0 -0
- {alt_python_logger-1.0.1 → alt_python_logger-1.1.0}/logger/logger.py +0 -0
- {alt_python_logger-1.0.1 → alt_python_logger-1.1.0}/logger/logger_category_cache.py +0 -0
- {alt_python_logger-1.0.1 → alt_python_logger-1.1.0}/logger/logger_factory.py +0 -0
- {alt_python_logger-1.0.1 → alt_python_logger-1.1.0}/logger/logger_level.py +0 -0
- {alt_python_logger-1.0.1 → alt_python_logger-1.1.0}/logger/multi_logger.py +0 -0
- {alt_python_logger-1.0.1 → alt_python_logger-1.1.0}/logger/plain_text_formatter.py +0 -0
- {alt_python_logger-1.0.1 → alt_python_logger-1.1.0}/tests/test_logger_full.py +0 -0
- {alt_python_logger-1.0.1 → alt_python_logger-1.1.0}/tests/test_logger_primitives.py +0 -0
|
@@ -40,6 +40,7 @@ from logger.json_formatter import JSONFormatter
|
|
|
40
40
|
from logger.plain_text_formatter import PlainTextFormatter
|
|
41
41
|
from logger.caching_console import CachingConsole
|
|
42
42
|
from logger.multi_logger import MultiLogger
|
|
43
|
+
from logger.caching_logger_factory import CachingLoggerFactory
|
|
43
44
|
|
|
44
45
|
# Module-level singleton — zero setup required.
|
|
45
46
|
logger_factory = LoggerFactory()
|
|
@@ -56,5 +57,6 @@ __all__ = [
|
|
|
56
57
|
"PlainTextFormatter",
|
|
57
58
|
"CachingConsole",
|
|
58
59
|
"MultiLogger",
|
|
60
|
+
"CachingLoggerFactory",
|
|
59
61
|
"logger_factory",
|
|
60
62
|
]
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"""
|
|
2
|
+
logger.caching_logger_factory — LoggerFactory variant that injects CachingConsole.
|
|
3
|
+
|
|
4
|
+
Intended for test use only: every logger produced by this factory writes
|
|
5
|
+
to an in-memory CachingConsole so tests can assert on emitted messages
|
|
6
|
+
without depending on stdout or a real config file.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
__author__ = "Craig Parravicini"
|
|
12
|
+
__collaborators__ = ["Claude (Anthropic)"]
|
|
13
|
+
|
|
14
|
+
from logger.logger_factory import LoggerFactory
|
|
15
|
+
from logger.configurable_logger import ConfigurableLogger
|
|
16
|
+
from logger.console_logger import ConsoleLogger
|
|
17
|
+
from logger.caching_console import CachingConsole
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class CachingLoggerFactory(LoggerFactory):
|
|
21
|
+
"""LoggerFactory that wires each logger with CachingConsole (test use only)."""
|
|
22
|
+
|
|
23
|
+
def get_logger(self, category=None) -> ConfigurableLogger:
|
|
24
|
+
cat = self._resolve_category(category)
|
|
25
|
+
formatter = self._get_formatter()
|
|
26
|
+
caching_console = CachingConsole()
|
|
27
|
+
provider = ConsoleLogger(category=cat, formatter=formatter, stdlib_logger=caching_console)
|
|
28
|
+
return ConfigurableLogger(
|
|
29
|
+
config=self.config,
|
|
30
|
+
provider=provider,
|
|
31
|
+
category=cat,
|
|
32
|
+
config_path=self.config_path,
|
|
33
|
+
cache=self.cache,
|
|
34
|
+
)
|
|
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
|