miu-logger 0.1.5__py3-none-any.whl → 0.1.6__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/stubgen.py CHANGED
@@ -2,7 +2,7 @@ from pathlib import Path
2
2
  from typing import Iterable
3
3
 
4
4
 
5
- TEMPLATE = """from typing import Optional
5
+ REPOSITORY_TEMPLATE = """from typing import Optional
6
6
  from queue import Queue
7
7
  from miu_logger.conditional import ConditionalLogger
8
8
  from miu_logger.config import LogConfig
@@ -24,17 +24,39 @@ class LoggingRepository:
24
24
  def shutdown(self) -> None: ...
25
25
  """
26
26
 
27
+ CONDITIONAL_LOGGER_STUB = """from typing import Any
28
+ import logging
29
+
30
+
31
+ class ConditionalLogger:
32
+ def __init__(self, logger: logging.Logger, should_log_debug: Any) -> None: ...
33
+
34
+ def debug(self, msg: str, *args: Any, **kwargs: Any) -> None: ...
35
+ def info(self, msg: str, *args: Any, **kwargs: Any) -> None: ...
36
+ def warning(self, msg: str, *args: Any, **kwargs: Any) -> None: ...
37
+ def error(self, msg: str, *args: Any, **kwargs: Any) -> None: ...
38
+ def critical(self, msg: str, *args: Any, **kwargs: Any) -> None: ...
39
+ def exception(self, msg: str, *args: Any, **kwargs: Any) -> None: ...
40
+ """
41
+
27
42
 
28
43
  def generate_repository_stub(domains: Iterable[str], out_dir: str = "typings") -> None:
29
44
  out_path = Path(out_dir) / "miu_logger"
30
45
  out_path.mkdir(parents=True, exist_ok=True)
31
46
 
47
+ # Generate repository.pyi
32
48
  lines = []
33
49
  for d in domains:
34
50
  lines.append(f" @property")
35
51
  lines.append(f" def {d}(self) -> ConditionalLogger: ...")
36
52
 
37
- content = TEMPLATE.format(domains="\n".join(lines))
38
-
53
+ content = REPOSITORY_TEMPLATE.format(domains="\n".join(lines))
54
+
39
55
  with open(out_path / "repository.pyi", "w") as f:
40
- f.write(content)
56
+ f.write(content)
57
+
58
+ # Generate conditional.pyi
59
+ with open(out_path / "conditional.pyi", "w") as f:
60
+ f.write(CONDITIONAL_LOGGER_STUB)
61
+
62
+ print(f"✓ Generated stubs in {out_path}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: miu-logger
3
- Version: 0.1.5
3
+ Version: 0.1.6
4
4
  Summary: Multiprocessing-safe domain-based logging framework with QueueListener architecture
5
5
  Author-email: Bruno Miura <brumiura@gmail.com>
6
6
  License-Expression: MIT
@@ -6,9 +6,9 @@ miu_logger/formatters.py,sha256=JshOwo4B0mT241ElCAs6nN-_IF_SgcZwmDt7k7tibuo,675
6
6
  miu_logger/listener.py,sha256=K6JDf-R3VQx6t1zfNnh3ltJRnAyYdV5TFTAeWQqc6bU,3336
7
7
  miu_logger/logger_factory.py,sha256=MhNaP73J9RbhmmVR6simqkZRCel2g6rPImRlijYAQXI,319
8
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,,
9
+ miu_logger/stubgen.py,sha256=w0TJRu2aG55Gs1_tKwOcU7f7Nmr6j0l36rMgMHsz-SM,1878
10
+ miu_logger-0.1.6.dist-info/licenses/LICENSE,sha256=jLLem0QFpsFv7Lkgp7I7FeN4DIdgCKIxzklfdkkesWg,1075
11
+ miu_logger-0.1.6.dist-info/METADATA,sha256=ufZi24rFlglR7Cb5qaNBPA3D54f3JSgjUGlXnu2xoq8,2915
12
+ miu_logger-0.1.6.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
13
+ miu_logger-0.1.6.dist-info/top_level.txt,sha256=70Nuj1YRYLMkqiRZv1pPZPhi_VystPGqm1nC3s-uHz4,11
14
+ miu_logger-0.1.6.dist-info/RECORD,,