beans-logging 6.0.3__py3-none-any.whl → 7.0.0__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: beans_logging
3
- Version: 6.0.3
3
+ Version: 7.0.0
4
4
  Summary: 'beans-logging' is a python package for simple logger and easily managing logs.
5
5
  Author-email: Batkhuu Byambajav <batkhuu10@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/bybatkhuu/module-python-logging
@@ -21,13 +21,13 @@ Classifier: Programming Language :: Python :: 3.13
21
21
  Requires-Python: <4.0,>=3.10
22
22
  Description-Content-Type: text/markdown
23
23
  License-File: LICENSE.txt
24
- Requires-Dist: PyYAML<7.0,>=6.0.2
25
- Requires-Dist: pydantic[timezone]!=2.1.0,<3.0.0,>=2.0.3
24
+ Requires-Dist: pydantic[timezone]<3.0.0,>=2.5.3
26
25
  Requires-Dist: loguru<1.0.0,>=0.7.3
26
+ Requires-Dist: potato_util<1.0.0,>=0.2.0
27
27
  Provides-Extra: fastapi
28
28
  Requires-Dist: beans-logging-fastapi<2.0.0,>=1.0.0; extra == "fastapi"
29
29
  Provides-Extra: test
30
- Requires-Dist: pytest<9.0.0,>=8.0.2; extra == "test"
30
+ Requires-Dist: pytest<10.0.0,>=8.0.2; extra == "test"
31
31
  Requires-Dist: pytest-cov<8.0.0,>=5.0.0; extra == "test"
32
32
  Requires-Dist: pytest-xdist<4.0.0,>=3.6.1; extra == "test"
33
33
  Requires-Dist: pytest-benchmark<6.0.0,>=5.0.1; extra == "test"
@@ -37,13 +37,13 @@ Requires-Dist: wheel<1.0.0,>=0.43.0; extra == "build"
37
37
  Requires-Dist: build<2.0.0,>=1.1.1; extra == "build"
38
38
  Requires-Dist: twine<7.0.0,>=6.0.1; extra == "build"
39
39
  Provides-Extra: docs
40
- Requires-Dist: pylint<4.0.0,>=3.0.4; extra == "docs"
40
+ Requires-Dist: pylint<5.0.0,>=3.0.4; extra == "docs"
41
41
  Requires-Dist: mkdocs-material<10.0.0,>=9.5.50; extra == "docs"
42
42
  Requires-Dist: mkdocs-awesome-nav<4.0.0,>=3.0.0; extra == "docs"
43
- Requires-Dist: mkdocstrings[python]<1.0.0,>=0.24.3; extra == "docs"
43
+ Requires-Dist: mkdocstrings[python]<2.0.0,>=0.24.3; extra == "docs"
44
44
  Requires-Dist: mike<3.0.0,>=2.1.3; extra == "docs"
45
45
  Provides-Extra: dev
46
- Requires-Dist: pytest<9.0.0,>=8.0.2; extra == "dev"
46
+ Requires-Dist: pytest<10.0.0,>=8.0.2; extra == "dev"
47
47
  Requires-Dist: pytest-cov<8.0.0,>=5.0.0; extra == "dev"
48
48
  Requires-Dist: pytest-xdist<4.0.0,>=3.6.1; extra == "dev"
49
49
  Requires-Dist: pytest-benchmark<6.0.0,>=5.0.1; extra == "dev"
@@ -51,10 +51,10 @@ Requires-Dist: setuptools<81.0.0,>=70.3.0; extra == "dev"
51
51
  Requires-Dist: wheel<1.0.0,>=0.43.0; extra == "dev"
52
52
  Requires-Dist: build<2.0.0,>=1.1.1; extra == "dev"
53
53
  Requires-Dist: twine<7.0.0,>=6.0.1; extra == "dev"
54
- Requires-Dist: pylint<4.0.0,>=3.0.4; extra == "dev"
54
+ Requires-Dist: pylint<5.0.0,>=3.0.4; extra == "dev"
55
55
  Requires-Dist: mkdocs-material<10.0.0,>=9.5.50; extra == "dev"
56
56
  Requires-Dist: mkdocs-awesome-nav<4.0.0,>=3.0.0; extra == "dev"
57
- Requires-Dist: mkdocstrings[python]<1.0.0,>=0.24.3; extra == "dev"
57
+ Requires-Dist: mkdocstrings[python]<2.0.0,>=0.24.3; extra == "dev"
58
58
  Requires-Dist: mike<3.0.0,>=2.1.3; extra == "dev"
59
59
  Requires-Dist: pyright<2.0.0,>=1.1.392; extra == "dev"
60
60
  Requires-Dist: pre-commit<5.0.0,>=4.0.1; extra == "dev"
@@ -217,12 +217,18 @@ logger.info("Logging info.")
217
217
 
218
218
  ```yml
219
219
  logger:
220
- app_name: "my-app"
221
- level: "TRACE"
222
- file:
223
- log_handlers:
220
+ app_name: my-app
221
+ default:
222
+ level:
223
+ base: TRACE
224
+ handlers:
225
+ default.all.file_handler:
224
226
  enabled: true
225
- json_handlers:
227
+ default.err.file_handler:
228
+ enabled: true
229
+ default.all.json_handler:
230
+ enabled: true
231
+ default.err.json_handler:
226
232
  enabled: true
227
233
  ```
228
234
 
@@ -273,28 +279,28 @@ python ./main.py
273
279
  **Output**:
274
280
 
275
281
  ```txt
276
- [2023-09-01 00:00:00.000 +09:00 | TRACE | beans_logging._base:478]: Intercepted modules: ['concurrent', 'concurrent.futures', 'asyncio']; Muted modules: [];
277
- [2023-09-01 00:00:00.000 +09:00 | TRACE | __main__:7]: Tracing...
278
- [2023-09-01 00:00:00.000 +09:00 | DEBUG | __main__:8]: Debugging...
279
- [2023-09-01 00:00:00.000 +09:00 | INFO | __main__:9]: Logging info.
280
- [2023-09-01 00:00:00.000 +09:00 | OK | __main__:10]: Success.
281
- [2023-09-01 00:00:00.000 +09:00 | WARN | __main__:11]: Warning something.
282
- [2023-09-01 00:00:00.000 +09:00 | ERROR | __main__:12]: Error occured.
283
- [2023-09-01 00:00:00.000 +09:00 | CRIT | __main__:13]: CRITICAL ERROR.
284
- [2023-09-01 00:00:00.000 +09:00 | ERROR | __main__:25]: division by zero
285
- [2023-09-01 00:00:00.000 +09:00 | ERROR | __main__:32]: Show me, what value is wrong:
282
+ [2025-11-01 00:00:00.735 +09:00 | TRACE | beans_logging._intercept:96]: Intercepted modules: ['potato_util._base', 'potato_util.io', 'concurrent', 'concurrent.futures', 'asyncio', 'potato_util.io._sync', 'potato_util']; Muted modules: [];
283
+ [2025-11-01 00:00:00.736 +09:00 | TRACE | __main__:6]: Tracing...
284
+ [2025-11-01 00:00:00.736 +09:00 | DEBUG | __main__:7]: Debugging...
285
+ [2025-11-01 00:00:00.736 +09:00 | INFO | __main__:8]: Logging info.
286
+ [2025-11-01 00:00:00.736 +09:00 | OK | __main__:9]: Success.
287
+ [2025-11-01 00:00:00.736 +09:00 | WARN | __main__:10]: Warning something.
288
+ [2025-11-01 00:00:00.736 +09:00 | ERROR | __main__:11]: Error occured.
289
+ [2025-11-01 00:00:00.736 +09:00 | CRIT | __main__:12]: CRITICAL ERROR.
290
+ [2025-11-01 00:00:00.736 +09:00 | ERROR | __main__:24]: division by zero
291
+ [2025-11-01 00:00:00.737 +09:00 | ERROR | __main__:31]: Show me, what value is wrong:
286
292
  Traceback (most recent call last):
287
293
 
288
- > File "/home/user/workspaces/projects/beans_logging/examples/simple/./main.py", line 30, in <module>
294
+ > File "/home/user/workspaces/projects/my/module-python-logging/examples/simple/./main.py", line 29, in <module>
289
295
  nested(0)
290
- └ <function nested at 0x10802a4c0>
296
+ └ <function nested at 0x102f37910>
291
297
 
292
- File "/home/user/workspaces/projects/beans_logging/examples/simple/./main.py", line 23, in nested
298
+ File "/home/user/workspaces/projects/my/module-python-logging/examples/simple/./main.py", line 22, in nested
293
299
  divide(5, c)
294
300
  │ └ 0
295
- └ <function divide at 0x1052f31f0>
301
+ └ <function divide at 0x102f377f0>
296
302
 
297
- File "/home/user/workspaces/projects/beans_logging/examples/simple/./main.py", line 17, in divide
303
+ File "/home/user/workspaces/projects/my/module-python-logging/examples/simple/./main.py", line 16, in divide
298
304
  _result = a / b
299
305
  │ └ 0
300
306
  └ 5
@@ -312,37 +318,54 @@ ZeroDivisionError: division by zero
312
318
 
313
319
  ```yaml
314
320
  logger:
315
- # app_name: "app"
316
- level: "INFO"
317
- use_diagnose: false
318
- stream:
319
- use_color: true
320
- use_icon: false
321
- format_str: "[<c>{time:YYYY-MM-DD HH:mm:ss.SSS Z}</c> | <level>{level_short:<5}</level> | <w>{name}:{line}</w>]: <level>{message}</level>"
322
- std_handler:
323
- enabled: true
324
- file:
325
- logs_dir: "./logs"
326
- rotate_size: 10000000 # 10MB
327
- rotate_time: "00:00:00"
328
- backup_count: 90
329
- log_handlers:
330
- enabled: false
331
- format_str: "[{time:YYYY-MM-DD HH:mm:ss.SSS Z} | {level_short:<5} | {name}:{line}]: {message}"
332
- log_path: "{app_name}.std.all.log"
333
- err_path: "{app_name}.std.err.log"
334
- json_handlers:
335
- enabled: false
336
- use_custom: false
337
- log_path: "{app_name}.json.all.log"
338
- err_path: "{app_name}.json.err.log"
321
+ # app_name: app
322
+ default:
323
+ level:
324
+ base: INFO
325
+ err: WARNING
326
+ std:
327
+ format_str: "[<c>{time:YYYY-MM-DD HH:mm:ss.SSS Z}</c> | <level>{extra[level_short]:<5}</level> | <w>{name}:{line}</w>]: <level>{message}</level>"
328
+ colorize: true
329
+ format_str: "[{time:YYYY-MM-DD HH:mm:ss.SSS Z} | {extra[level_short]:<5} | {name}:{line}]: {message}"
330
+ file:
331
+ logs_dir: "./logs"
332
+ rotate_size: 10000000
333
+ rotate_time: "00:00:00"
334
+ retention: 90
335
+ encoding: utf8
336
+ plain:
337
+ log_path: "{app_name}.all.log"
338
+ err_path: "{app_name}.err.log"
339
+ json:
340
+ log_path: "json/{app_name}.json.all.log"
341
+ err_path: "json/{app_name}.json.err.log"
342
+ custom_serialize: false
339
343
  intercept:
340
- auto_load:
341
- enabled: true
342
- only_base: false
343
- ignore_modules: []
344
+ enabled: true
345
+ only_base: false
346
+ ignore_modules: []
344
347
  include_modules: []
345
348
  mute_modules: []
349
+ handlers:
350
+ default.all.std_handler:
351
+ type: STD
352
+ enabled: true
353
+ default.all.file_handler:
354
+ type: FILE
355
+ enabled: false
356
+ default.err.file_handler:
357
+ type: FILE
358
+ error: true
359
+ enabled: false
360
+ default.all.json_handler:
361
+ type: FILE
362
+ serialize: true
363
+ enabled: false
364
+ default.err.json_handler:
365
+ type: FILE
366
+ serialize: true
367
+ error: true
368
+ enabled: false
346
369
  extra:
347
370
  ```
348
371
 
@@ -354,10 +377,6 @@ logger:
354
377
  # ENV=LOCAL
355
378
  # DEBUG=false
356
379
  # TZ=UTC
357
-
358
- # BEANS_LOGGING_DISABLE_DEFAULT=false
359
- # BEANS_LOGGING_CONFIG_PATH="./configs/logger.yml"
360
- # BEANS_LOGGING_LOGS_DIR="./logs"
361
380
  ```
362
381
 
363
382
  ---
@@ -0,0 +1,18 @@
1
+ beans_logging/__init__.py,sha256=KOXpuCNTMsdlY9MF6ONwRjM5O1_JCkIzt_qetb2BFTw,261
2
+ beans_logging/__version__.py,sha256=VgMOOqsYbyb60I1RmlZpqwqQ0C0IyT3R0c8_xX4pRGM,22
3
+ beans_logging/_builder.py,sha256=KUHZLMj6AqyDQGpVVB4XGEP3xI_kkjNMG-pbV_PvtLE,5644
4
+ beans_logging/_constants.py,sha256=rH9ZN-b7GXNXjbpOZUJfsft54Eiy8jnXm82jsFcMo3k,510
5
+ beans_logging/_core.py,sha256=qkGl5NRKY7lKuVatwFmddwxeYS5viU5DDnfKucWK3Mo,9617
6
+ beans_logging/_intercept.py,sha256=TeYze0eXRMVkOoC9Bl2qmaC7fSwExfQAmmGHz5KiuCU,3249
7
+ beans_logging/auto.py,sha256=MoNuQomiIFWQVpNTkOmFFVMo00HBlErfHC728GFOyqc,218
8
+ beans_logging/config.py,sha256=yDA-IbjhMIgP1DrFKa0ZDibNWAH_Ov8R7Hnqfggl71E,6172
9
+ beans_logging/filters.py,sha256=-Rys2rwuT7EUvuEA19jnhW6enIEkDuPzeGbAAz6RJSc,3720
10
+ beans_logging/formats.py,sha256=Vrr4RkCfiJl-oi6BLVxeR-k0WhTR0oBI4mpsWgBJBNE,1624
11
+ beans_logging/rotators.py,sha256=lzR31sdEPTZVDkyhC81FL4OnezIVKlElGJDRA2Svn2I,2121
12
+ beans_logging/schemas.py,sha256=b4igq8CkAzn7CGOBDc09hW0YTvWyuWRe97fpv_OaNdk,4444
13
+ beans_logging/sinks.py,sha256=7Guusg3N1S-28hLnRzuunP8lXnhexzny3aj-AR0HhuQ,482
14
+ beans_logging-7.0.0.dist-info/licenses/LICENSE.txt,sha256=CUTK-r0BWIg1r0bBiemAcMhakgV0N7HuRhw6rQ-A9A4,1074
15
+ beans_logging-7.0.0.dist-info/METADATA,sha256=v6LwlP4Gc4ZnyvYnVHka9okW38UV9e2f2A_23-5Q9qs,13155
16
+ beans_logging-7.0.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
17
+ beans_logging-7.0.0.dist-info/top_level.txt,sha256=lx8JEqYGNha1sYbVrTtMo2Z01A7Shq8hX6bfsuKLTG8,14
18
+ beans_logging-7.0.0.dist-info/RECORD,,