miu-logger 0.1.3__py3-none-any.whl → 0.1.5__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.
- miu_logger/listener.py +1 -1
- miu_logger/repository.py +7 -1
- miu_logger/stubgen.py +18 -3
- {miu_logger-0.1.3.dist-info → miu_logger-0.1.5.dist-info}/METADATA +1 -1
- {miu_logger-0.1.3.dist-info → miu_logger-0.1.5.dist-info}/RECORD +8 -8
- {miu_logger-0.1.3.dist-info → miu_logger-0.1.5.dist-info}/WHEEL +0 -0
- {miu_logger-0.1.3.dist-info → miu_logger-0.1.5.dist-info}/licenses/LICENSE +0 -0
- {miu_logger-0.1.3.dist-info → miu_logger-0.1.5.dist-info}/top_level.txt +0 -0
miu_logger/listener.py
CHANGED
miu_logger/repository.py
CHANGED
|
@@ -73,4 +73,10 @@ class LoggingRepository:
|
|
|
73
73
|
return {"config": self.config, "queue": self.queue}
|
|
74
74
|
|
|
75
75
|
def __setstate__(self, state):
|
|
76
|
-
self.
|
|
76
|
+
self._is_shutdown = False
|
|
77
|
+
self.config = state["config"]
|
|
78
|
+
self.queue = state["queue"]
|
|
79
|
+
self.listener = None
|
|
80
|
+
self._domains = set(self.config.domains)
|
|
81
|
+
self._loggers = {}
|
|
82
|
+
atexit.register(self.shutdown)
|
miu_logger/stubgen.py
CHANGED
|
@@ -2,12 +2,26 @@ from pathlib import Path
|
|
|
2
2
|
from typing import Iterable
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
TEMPLATE = """from typing import
|
|
5
|
+
TEMPLATE = """from typing import Optional
|
|
6
|
+
from queue import Queue
|
|
6
7
|
from miu_logger.conditional import ConditionalLogger
|
|
8
|
+
from miu_logger.config import LogConfig
|
|
7
9
|
|
|
8
10
|
|
|
9
11
|
class LoggingRepository:
|
|
12
|
+
def __init__(
|
|
13
|
+
self,
|
|
14
|
+
config: LogConfig,
|
|
15
|
+
*,
|
|
16
|
+
use_listener: bool = True,
|
|
17
|
+
queue: Optional[Queue] = None
|
|
18
|
+
) -> None: ...
|
|
19
|
+
|
|
10
20
|
{domains}
|
|
21
|
+
|
|
22
|
+
def get(self, domain: str) -> ConditionalLogger: ...
|
|
23
|
+
def get_queue(self) -> Queue: ...
|
|
24
|
+
def shutdown(self) -> None: ...
|
|
11
25
|
"""
|
|
12
26
|
|
|
13
27
|
|
|
@@ -17,9 +31,10 @@ def generate_repository_stub(domains: Iterable[str], out_dir: str = "typings") -
|
|
|
17
31
|
|
|
18
32
|
lines = []
|
|
19
33
|
for d in domains:
|
|
20
|
-
lines.append(f"
|
|
34
|
+
lines.append(f" @property")
|
|
35
|
+
lines.append(f" def {d}(self) -> ConditionalLogger: ...")
|
|
21
36
|
|
|
22
37
|
content = TEMPLATE.format(domains="\n".join(lines))
|
|
23
38
|
|
|
24
39
|
with open(out_path / "repository.pyi", "w") as f:
|
|
25
|
-
f.write(content)
|
|
40
|
+
f.write(content)
|
|
@@ -3,12 +3,12 @@ miu_logger/conditional.py,sha256=j0XnxF7diXCvovhJlRMf7gKGtP1UOK72J5WXVYe6L7M,566
|
|
|
3
3
|
miu_logger/config.py,sha256=JyBDoSHMA4-BZT2ZnB2-978IoIPsn495OU6QsxUjlyA,197
|
|
4
4
|
miu_logger/filters.py,sha256=CPPjDzlrB07Ku4QxsuYl87RetzppwJTcVml657O6y68,475
|
|
5
5
|
miu_logger/formatters.py,sha256=JshOwo4B0mT241ElCAs6nN-_IF_SgcZwmDt7k7tibuo,675
|
|
6
|
-
miu_logger/listener.py,sha256=
|
|
6
|
+
miu_logger/listener.py,sha256=K6JDf-R3VQx6t1zfNnh3ltJRnAyYdV5TFTAeWQqc6bU,3336
|
|
7
7
|
miu_logger/logger_factory.py,sha256=MhNaP73J9RbhmmVR6simqkZRCel2g6rPImRlijYAQXI,319
|
|
8
|
-
miu_logger/repository.py,sha256=
|
|
9
|
-
miu_logger/stubgen.py,sha256
|
|
10
|
-
miu_logger-0.1.
|
|
11
|
-
miu_logger-0.1.
|
|
12
|
-
miu_logger-0.1.
|
|
13
|
-
miu_logger-0.1.
|
|
14
|
-
miu_logger-0.1.
|
|
8
|
+
miu_logger/repository.py,sha256=FQOO-njKzW6i528EJpDYfusPDbW2DEGcVpxnqHUbzgg,2458
|
|
9
|
+
miu_logger/stubgen.py,sha256=-okTP1GExdNob1qUtHgBoJEG-aRNb1N1koxAuNXkP90,1022
|
|
10
|
+
miu_logger-0.1.5.dist-info/licenses/LICENSE,sha256=jLLem0QFpsFv7Lkgp7I7FeN4DIdgCKIxzklfdkkesWg,1075
|
|
11
|
+
miu_logger-0.1.5.dist-info/METADATA,sha256=SbXUaY82ZIMB6lFhk3Pb3hcGxKKuxmLe1vNn2x3w9uI,2915
|
|
12
|
+
miu_logger-0.1.5.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
13
|
+
miu_logger-0.1.5.dist-info/top_level.txt,sha256=70Nuj1YRYLMkqiRZv1pPZPhi_VystPGqm1nC3s-uHz4,11
|
|
14
|
+
miu_logger-0.1.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|