miu-logger 0.1.0__py3-none-any.whl → 0.1.1__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 ADDED
File without changes
@@ -0,0 +1,152 @@
1
+ Metadata-Version: 2.4
2
+ Name: miu-logger
3
+ Version: 0.1.1
4
+ Summary: Multiprocessing-safe domain-based logging framework with QueueListener architecture
5
+ Author-email: Bruno Miura <brumiura@gmail.com>
6
+ License: MIT
7
+ Keywords: logging,multiprocessing,queue,structured-logging,python-logging
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Programming Language :: Python :: 3 :: Only
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Topic :: System :: Logging
13
+ Requires-Python: >=3.10
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+ Requires-Dist: colorama
17
+ Dynamic: license-file
18
+
19
+ ```python
20
+ repo = LoggingRepository(config)
21
+ queue = repo.get_queue()
22
+ ```
23
+
24
+ **Worker processes:**
25
+
26
+ ```python
27
+ worker_repo = LoggingRepository(config, use_listener=False, queue=queue)
28
+ worker_repo.task.info("Worker started")
29
+ ```
30
+
31
+ All processes log safely to the same listener and files.
32
+
33
+ ---
34
+
35
+ ## Debug Control
36
+
37
+ Only `.debug()` messages are conditional via `debug_enabled`:
38
+
39
+ ```python
40
+ config.debug_enabled = False
41
+ repo.app.debug("Won't appear")
42
+ repo.app.info("Will appear")
43
+ ```
44
+
45
+ Useful for toggling debug messages in production.
46
+
47
+ ---
48
+
49
+ ## Output Structure
50
+
51
+ Logs are written in:
52
+
53
+ ```
54
+ logs/
55
+ ├─ app.log # domain logs
56
+ ├─ db.log
57
+ ├─ redis.log
58
+ ├─ debug.log # per-level logs
59
+ ├─ info.log
60
+ ├─ warning.log
61
+ └─ error.log
62
+ ```
63
+
64
+ Console output is **colorized** by level:
65
+
66
+ * DEBUG → blue
67
+ * INFO → green
68
+ * WARNING → yellow
69
+ * ERROR → red
70
+
71
+ Files remain clean.
72
+
73
+ ---
74
+
75
+ ## Graceful Shutdown
76
+
77
+ The repository automatically shuts down on process exit and supports manual shutdown:
78
+
79
+ ```python
80
+ repo.shutdown()
81
+ ```
82
+
83
+ ---
84
+
85
+ ## Typical Usage Example
86
+
87
+ ```python
88
+ repo.app.info("Service starting")
89
+
90
+ try:
91
+ connect_db()
92
+ except Exception:
93
+ repo.db.exception("DB connection failed")
94
+
95
+ repo.redis.debug("Cache size: %d", cache_size)
96
+ ```
97
+
98
+ **Multiprocessing workers:**
99
+
100
+ ```python
101
+ def worker(queue):
102
+ repo = LoggingRepository(config, use_listener=False, queue=queue)
103
+ repo.task.info("Worker task started")
104
+ ```
105
+
106
+ ---
107
+
108
+ ## Project Structure
109
+
110
+ ```
111
+ miu_logger/
112
+ ├─ repository.py # main LoggingRepository
113
+ ├─ listener.py # QueueListener and handler setup
114
+ ├─ logger_factory.py # logger creation functions
115
+ ├─ conditional.py # ConditionalLogger
116
+ ├─ filters.py # Logger filters
117
+ ├─ formatters.py # ColoredFormatter
118
+ ├─ config.py # LogConfig definition
119
+ └─ stubgen.py # stub generator for IDE autocomplete
120
+ ```
121
+
122
+ ---
123
+
124
+ ## When to Use
125
+
126
+ * Services with many subsystems
127
+ * Multiprocessing ingestion pipelines
128
+ * Long-running daemons
129
+ * Kubernetes / systemd services
130
+ * Need for clear operational logs
131
+
132
+ ---
133
+
134
+ ## When Not to Use
135
+
136
+ * Single-file scripts
137
+ * No multiprocessing
138
+ * No domain separation required
139
+
140
+ Plain `logging` is sufficient in those cases.
141
+
142
+ ---
143
+
144
+ ## License
145
+
146
+ MIT
147
+
148
+ ---
149
+
150
+ ## Author
151
+
152
+ **Bruno Miura**
@@ -6,8 +6,9 @@ miu_logger/formatters.py,sha256=JshOwo4B0mT241ElCAs6nN-_IF_SgcZwmDt7k7tibuo,675
6
6
  miu_logger/listener.py,sha256=ZBw8i-f-pouPdnuw-DXEKS4ZvWIHoUtiAPMzsIomj4g,3301
7
7
  miu_logger/logger_factory.py,sha256=MhNaP73J9RbhmmVR6simqkZRCel2g6rPImRlijYAQXI,319
8
8
  miu_logger/repository.py,sha256=XQPkJjuYzUKNiNUmPSxRd2CygdKThB_PHIyq0WTFkic,2288
9
- miu_logger-0.1.0.dist-info/licenses/LICENSE,sha256=jLLem0QFpsFv7Lkgp7I7FeN4DIdgCKIxzklfdkkesWg,1075
10
- miu_logger-0.1.0.dist-info/METADATA,sha256=QlWdb9LomoTwTDmsy3EG4OUrpMyNFeV11nVD0ArB9yE,265
11
- miu_logger-0.1.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
12
- miu_logger-0.1.0.dist-info/top_level.txt,sha256=70Nuj1YRYLMkqiRZv1pPZPhi_VystPGqm1nC3s-uHz4,11
13
- miu_logger-0.1.0.dist-info/RECORD,,
9
+ miu_logger/stubgen.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
+ miu_logger-0.1.1.dist-info/licenses/LICENSE,sha256=jLLem0QFpsFv7Lkgp7I7FeN4DIdgCKIxzklfdkkesWg,1075
11
+ miu_logger-0.1.1.dist-info/METADATA,sha256=Djdvy-KBHysCSdSK0d2nKiiCWRQYtYF5Fs5eDnFznUk,2955
12
+ miu_logger-0.1.1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
13
+ miu_logger-0.1.1.dist-info/top_level.txt,sha256=70Nuj1YRYLMkqiRZv1pPZPhi_VystPGqm1nC3s-uHz4,11
14
+ miu_logger-0.1.1.dist-info/RECORD,,
@@ -1,10 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: miu-logger
3
- Version: 0.1.0
4
- Summary: Multiprocessing-safe structured logging framework
5
- Author: Bruno Miura
6
- Requires-Python: >=3.10
7
- Description-Content-Type: text/markdown
8
- License-File: LICENSE
9
- Requires-Dist: colorama
10
- Dynamic: license-file