logdruid 0.1.0.dev1__tar.gz → 0.1.0.dev2__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.
@@ -0,0 +1,77 @@
1
+ Metadata-Version: 2.4
2
+ Name: logdruid
3
+ Version: 0.1.0.dev2
4
+ Summary: A drop-in logging setup layer for multi-process applications, built on loguru.
5
+ License-Expression: MIT
6
+ License-File: LICENSE
7
+ Author: Frank Herbrand
8
+ Author-email: f.herbrand@hzdr.de
9
+ Requires-Python: >=3.11,<4.0
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.11
12
+ Classifier: Programming Language :: Python :: 3.12
13
+ Classifier: Programming Language :: Python :: 3.13
14
+ Classifier: Programming Language :: Python :: 3.14
15
+ Classifier: Programming Language :: Python :: 3.15
16
+ Requires-Dist: loguru (>=0.7.3)
17
+ Description-Content-Type: text/markdown
18
+
19
+ # logdruid
20
+
21
+ [![PyPI version](https://img.shields.io/pypi/v/logdruid.svg)](https://pypi.org/project/logdruid/)
22
+ [![Tests](https://github.com/fherb2/logdruid/actions/workflows/tests.yml/badge.svg)](https://github.com/fherb2/logdruid/actions/workflows/tests.yml)
23
+
24
+ A drop-in logging setup layer for multi-process applications, built on
25
+ [loguru](https://loguru.readthedocs.io/).
26
+
27
+ **Installation, usage, configuration and API:
28
+ <https://fherb2.github.io/logdruid/>**
29
+
30
+ ## What it is for
31
+
32
+ loguru is a logging library for Python with exactly one global logger. In an
33
+ application with several processes, loguru alone reaches its limits: each
34
+ process started with `spawn` has its own logger with its own outputs; a
35
+ shared output across processes goes through a queue whose lock spans all
36
+ processes, so a process killed hard while holding it can block logging
37
+ everywhere; and messages from libraries that report through the standard
38
+ `logging` module do not appear in loguru's outputs.
39
+
40
+ logdruid is a setup layer around loguru for exactly this case: applications
41
+ – not libraries – with several processes. It does not build a logging API of
42
+ its own: you keep reporting with loguru's logger, unchanged. logdruid only
43
+ sets it up and adds what loguru does not offer: one shared output for all
44
+ processes, ordered by time, without a lock across process boundaries; taking
45
+ over the messages from `logging`; and a configuration in a file of its own.
46
+
47
+ For an application with a single process, loguru alone is enough, as it is
48
+ when each process may write to its own file and the order across processes
49
+ does not matter. Libraries should use neither loguru nor logdruid but report
50
+ through `logging`.
51
+
52
+ ## Features
53
+
54
+ | Feature | loguru alone | with logdruid |
55
+ | --- | --- | --- |
56
+ | Reporting with `logger.info(...)` etc., levels `TRACE` to `CRITICAL` including `SUCCESS` | yes | yes, the same logger and the same API |
57
+ | Console and file, rotation and retention of the file, format, colours | yes | yes, set in the configuration file |
58
+ | Exceptions with extended tracebacks, optionally with variable values | yes | yes |
59
+ | All processes write into one shared output | yes, through a shared queue with a lock across all processes | yes, through a pipe of its own per child process, without a shared lock |
60
+ | A process killed hard does not hold up the others | not guaranteed | yes |
61
+ | Messages of all processes ordered by time | no, order of arrival | yes, with an adjustable time window |
62
+ | Minimum level per name of a message (module, logger) | yes, through a filter | yes |
63
+ | Minimum level per process | no | yes |
64
+ | Taking over messages from `logging` | only as a code example in loguru's documentation | yes, with the logger's name and with level translation per logger |
65
+ | Configuration from a file, precedence defaults < application < file < command line | no, only environment variables | yes |
66
+ | Mistakes in the configuration do not stop the application | no | yes, they only produce a warning |
67
+
68
+ ## For contributors
69
+
70
+ Design rules and rationale are in
71
+ [`running_implementation_doc/`](https://github.com/fherb2/logdruid/tree/main/running_implementation_doc)
72
+ (in German).
73
+
74
+ ## License
75
+
76
+ MIT, see [`LICENSE`](https://github.com/fherb2/logdruid/blob/main/LICENSE).
77
+
@@ -0,0 +1,58 @@
1
+ # logdruid
2
+
3
+ [![PyPI version](https://img.shields.io/pypi/v/logdruid.svg)](https://pypi.org/project/logdruid/)
4
+ [![Tests](https://github.com/fherb2/logdruid/actions/workflows/tests.yml/badge.svg)](https://github.com/fherb2/logdruid/actions/workflows/tests.yml)
5
+
6
+ A drop-in logging setup layer for multi-process applications, built on
7
+ [loguru](https://loguru.readthedocs.io/).
8
+
9
+ **Installation, usage, configuration and API:
10
+ <https://fherb2.github.io/logdruid/>**
11
+
12
+ ## What it is for
13
+
14
+ loguru is a logging library for Python with exactly one global logger. In an
15
+ application with several processes, loguru alone reaches its limits: each
16
+ process started with `spawn` has its own logger with its own outputs; a
17
+ shared output across processes goes through a queue whose lock spans all
18
+ processes, so a process killed hard while holding it can block logging
19
+ everywhere; and messages from libraries that report through the standard
20
+ `logging` module do not appear in loguru's outputs.
21
+
22
+ logdruid is a setup layer around loguru for exactly this case: applications
23
+ – not libraries – with several processes. It does not build a logging API of
24
+ its own: you keep reporting with loguru's logger, unchanged. logdruid only
25
+ sets it up and adds what loguru does not offer: one shared output for all
26
+ processes, ordered by time, without a lock across process boundaries; taking
27
+ over the messages from `logging`; and a configuration in a file of its own.
28
+
29
+ For an application with a single process, loguru alone is enough, as it is
30
+ when each process may write to its own file and the order across processes
31
+ does not matter. Libraries should use neither loguru nor logdruid but report
32
+ through `logging`.
33
+
34
+ ## Features
35
+
36
+ | Feature | loguru alone | with logdruid |
37
+ | --- | --- | --- |
38
+ | Reporting with `logger.info(...)` etc., levels `TRACE` to `CRITICAL` including `SUCCESS` | yes | yes, the same logger and the same API |
39
+ | Console and file, rotation and retention of the file, format, colours | yes | yes, set in the configuration file |
40
+ | Exceptions with extended tracebacks, optionally with variable values | yes | yes |
41
+ | All processes write into one shared output | yes, through a shared queue with a lock across all processes | yes, through a pipe of its own per child process, without a shared lock |
42
+ | A process killed hard does not hold up the others | not guaranteed | yes |
43
+ | Messages of all processes ordered by time | no, order of arrival | yes, with an adjustable time window |
44
+ | Minimum level per name of a message (module, logger) | yes, through a filter | yes |
45
+ | Minimum level per process | no | yes |
46
+ | Taking over messages from `logging` | only as a code example in loguru's documentation | yes, with the logger's name and with level translation per logger |
47
+ | Configuration from a file, precedence defaults < application < file < command line | no, only environment variables | yes |
48
+ | Mistakes in the configuration do not stop the application | no | yes, they only produce a warning |
49
+
50
+ ## For contributors
51
+
52
+ Design rules and rationale are in
53
+ [`running_implementation_doc/`](https://github.com/fherb2/logdruid/tree/main/running_implementation_doc)
54
+ (in German).
55
+
56
+ ## License
57
+
58
+ MIT, see [`LICENSE`](https://github.com/fherb2/logdruid/blob/main/LICENSE).
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
4
4
 
5
5
  [project]
6
6
  name = "logdruid"
7
- version = "0.1.0.dev1"
7
+ version = "0.1.0.dev2"
8
8
  description = "A drop-in logging setup layer for multi-process applications, built on loguru."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11,<4.0"
@@ -1,97 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: logdruid
3
- Version: 0.1.0.dev1
4
- Summary: A drop-in logging setup layer for multi-process applications, built on loguru.
5
- License-Expression: MIT
6
- License-File: LICENSE
7
- Author: Frank Herbrand
8
- Author-email: f.herbrand@hzdr.de
9
- Requires-Python: >=3.11,<4.0
10
- Classifier: Programming Language :: Python :: 3
11
- Classifier: Programming Language :: Python :: 3.11
12
- Classifier: Programming Language :: Python :: 3.12
13
- Classifier: Programming Language :: Python :: 3.13
14
- Classifier: Programming Language :: Python :: 3.14
15
- Classifier: Programming Language :: Python :: 3.15
16
- Requires-Dist: loguru (>=0.7.3)
17
- Description-Content-Type: text/markdown
18
-
19
- # logdruid
20
-
21
- [![PyPI version](https://img.shields.io/pypi/v/logdruid.svg)](https://pypi.org/project/logdruid/)
22
- [![Tests](https://github.com/fherb2/logdruid/actions/workflows/tests.yml/badge.svg)](https://github.com/fherb2/logdruid/actions/workflows/tests.yml)
23
-
24
- A drop-in logging setup layer for multi-process applications, built on
25
- [loguru](https://loguru.readthedocs.io/).
26
-
27
- logdruid does not replace loguru's API — it uses it unchanged — and adds
28
- what a multi-process application needs on top: a single, time-ordered
29
- output across process boundaries, without a lock shared between
30
- processes, and the ability to take over messages from libraries that
31
- report through the standard `logging` module.
32
-
33
- ## Installation
34
-
35
- ```bash
36
- pip install logdruid
37
- ```
38
-
39
- Requires Python 3.11 or later.
40
-
41
- ## Usage
42
-
43
- Main process, once, before any child process is created:
44
-
45
- ```python
46
- import logdruid
47
- from logdruid import logger
48
-
49
- logdruid.setup(config_path, cli_level=args.log_level)
50
- logger.success("Logging active")
51
- ```
52
-
53
- Per child process, in the main process:
54
-
55
- ```python
56
- link = logdruid.link("raw_writer")
57
- process = ctx.Process(target=raw_writer_prc, args=(link, ...),
58
- name="raw_writer")
59
- process.start()
60
- link.release()
61
- ```
62
-
63
- First thing in the child process (after ignoring `SIGINT`):
64
-
65
- ```python
66
- logdruid.attach(link)
67
- ```
68
-
69
- At the end of the main process, after the children have ended:
70
-
71
- ```python
72
- logdruid.shutdown()
73
- ```
74
-
75
- Application modules report through `from logdruid import logger` — loguru's
76
- own global logger, unchanged. Libraries that report through the standard
77
- `logging` module need no changes of their own; logdruid takes over their
78
- messages and applies the level translations configured for them.
79
-
80
- ## Configuration
81
-
82
- Everything logdruid-specific lives in a `logdruid.toml` file next to the
83
- application's entry point. A fully commented example, including how to
84
- assign levels per process and per logger and how to translate a library's
85
- levels into the application's own scheme, is in
86
- [`examples/logdruid.toml`](examples/logdruid.toml).
87
-
88
- ## Documentation
89
-
90
- The full set of project-wide rules and design rationale is in
91
- [`running_implementation_doc/implementierungsdoku.md`](running_implementation_doc/implementierungsdoku.md)
92
- (in German).
93
-
94
- ## License
95
-
96
- MIT, see [`LICENSE`](LICENSE).
97
-
@@ -1,78 +0,0 @@
1
- # logdruid
2
-
3
- [![PyPI version](https://img.shields.io/pypi/v/logdruid.svg)](https://pypi.org/project/logdruid/)
4
- [![Tests](https://github.com/fherb2/logdruid/actions/workflows/tests.yml/badge.svg)](https://github.com/fherb2/logdruid/actions/workflows/tests.yml)
5
-
6
- A drop-in logging setup layer for multi-process applications, built on
7
- [loguru](https://loguru.readthedocs.io/).
8
-
9
- logdruid does not replace loguru's API — it uses it unchanged — and adds
10
- what a multi-process application needs on top: a single, time-ordered
11
- output across process boundaries, without a lock shared between
12
- processes, and the ability to take over messages from libraries that
13
- report through the standard `logging` module.
14
-
15
- ## Installation
16
-
17
- ```bash
18
- pip install logdruid
19
- ```
20
-
21
- Requires Python 3.11 or later.
22
-
23
- ## Usage
24
-
25
- Main process, once, before any child process is created:
26
-
27
- ```python
28
- import logdruid
29
- from logdruid import logger
30
-
31
- logdruid.setup(config_path, cli_level=args.log_level)
32
- logger.success("Logging active")
33
- ```
34
-
35
- Per child process, in the main process:
36
-
37
- ```python
38
- link = logdruid.link("raw_writer")
39
- process = ctx.Process(target=raw_writer_prc, args=(link, ...),
40
- name="raw_writer")
41
- process.start()
42
- link.release()
43
- ```
44
-
45
- First thing in the child process (after ignoring `SIGINT`):
46
-
47
- ```python
48
- logdruid.attach(link)
49
- ```
50
-
51
- At the end of the main process, after the children have ended:
52
-
53
- ```python
54
- logdruid.shutdown()
55
- ```
56
-
57
- Application modules report through `from logdruid import logger` — loguru's
58
- own global logger, unchanged. Libraries that report through the standard
59
- `logging` module need no changes of their own; logdruid takes over their
60
- messages and applies the level translations configured for them.
61
-
62
- ## Configuration
63
-
64
- Everything logdruid-specific lives in a `logdruid.toml` file next to the
65
- application's entry point. A fully commented example, including how to
66
- assign levels per process and per logger and how to translate a library's
67
- levels into the application's own scheme, is in
68
- [`examples/logdruid.toml`](examples/logdruid.toml).
69
-
70
- ## Documentation
71
-
72
- The full set of project-wide rules and design rationale is in
73
- [`running_implementation_doc/implementierungsdoku.md`](running_implementation_doc/implementierungsdoku.md)
74
- (in German).
75
-
76
- ## License
77
-
78
- MIT, see [`LICENSE`](LICENSE).
File without changes