tremors 0.4.0__py3-none-any.whl → 0.4.2__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.
- tremors/__init__.py +1 -1
- tremors/collector.py +3 -10
- tremors/decorator.py +5 -8
- tremors/logger.py +3 -9
- {tremors-0.4.0.dist-info → tremors-0.4.2.dist-info}/METADATA +3 -2
- tremors-0.4.2.dist-info/RECORD +10 -0
- {tremors-0.4.0.dist-info → tremors-0.4.2.dist-info}/WHEEL +1 -1
- tremors-0.4.0.dist-info/RECORD +0 -10
- {tremors-0.4.0.dist-info → tremors-0.4.2.dist-info}/licenses/LICENSE +0 -0
- {tremors-0.4.0.dist-info → tremors-0.4.2.dist-info}/top_level.txt +0 -0
tremors/__init__.py
CHANGED
tremors/collector.py
CHANGED
|
@@ -14,20 +14,13 @@ fixed signature as described in :class:`Formatter`.
|
|
|
14
14
|
|
|
15
15
|
import dataclasses
|
|
16
16
|
import logging
|
|
17
|
-
import sys
|
|
18
17
|
import time
|
|
19
|
-
|
|
20
|
-
from
|
|
18
|
+
import uuid # noqa: TC003
|
|
19
|
+
from collections.abc import Callable, Mapping
|
|
20
|
+
from typing import NamedTuple, Protocol
|
|
21
21
|
|
|
22
22
|
import tremors.logger
|
|
23
23
|
|
|
24
|
-
if TYPE_CHECKING:
|
|
25
|
-
import uuid
|
|
26
|
-
from collections.abc import Callable
|
|
27
|
-
elif "sphinx" in sys.modules:
|
|
28
|
-
import uuid # noqa: TC003
|
|
29
|
-
from collections.abc import Callable
|
|
30
|
-
|
|
31
24
|
|
|
32
25
|
def get_state[T](typ: type[T], name: str, record: logging.LogRecord) -> T | None:
|
|
33
26
|
"""Get the collector state from a :class:`~logging.LogRecord`.
|
tremors/decorator.py
CHANGED
|
@@ -5,13 +5,8 @@ and injects that logger into the callable.
|
|
|
5
5
|
"""
|
|
6
6
|
|
|
7
7
|
import functools
|
|
8
|
-
import
|
|
9
|
-
from typing import
|
|
10
|
-
|
|
11
|
-
if TYPE_CHECKING:
|
|
12
|
-
from collections.abc import Callable
|
|
13
|
-
elif "sphinx" in sys.modules:
|
|
14
|
-
from collections.abc import Callable # noqa: TC003
|
|
8
|
+
from collections.abc import Callable # noqa: TC003
|
|
9
|
+
from typing import Any, cast, overload
|
|
15
10
|
|
|
16
11
|
import tremors.logger
|
|
17
12
|
|
|
@@ -35,7 +30,9 @@ def _logged[TRet, **P](
|
|
|
35
30
|
|
|
36
31
|
@overload
|
|
37
32
|
def logged[TRet, **P](
|
|
38
|
-
*collectors: tremors.logger.Collector[Any],
|
|
33
|
+
*collectors: tremors.logger.Collector[Any],
|
|
34
|
+
name: str | None = None,
|
|
35
|
+
logger_name: str | None = None,
|
|
39
36
|
) -> Callable[[Callable[P, TRet]], Callable[P, TRet]]: ...
|
|
40
37
|
|
|
41
38
|
|
tremors/logger.py
CHANGED
|
@@ -45,16 +45,10 @@ import contextvars
|
|
|
45
45
|
import functools
|
|
46
46
|
import itertools
|
|
47
47
|
import logging
|
|
48
|
-
import sys
|
|
49
48
|
import uuid
|
|
50
|
-
from
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
from collections.abc import Callable, Mapping, MutableMapping
|
|
54
|
-
from types import TracebackType
|
|
55
|
-
elif "sphinx" in sys.modules:
|
|
56
|
-
from collections.abc import Callable, Mapping # noqa: TC003
|
|
57
|
-
from types import TracebackType # noqa: TC003
|
|
49
|
+
from collections.abc import Callable, Mapping, MutableMapping # noqa: TC003
|
|
50
|
+
from types import TracebackType # noqa: TC003
|
|
51
|
+
from typing import Any, NamedTuple, Self
|
|
58
52
|
|
|
59
53
|
_current_logger: contextvars.ContextVar[Logger | None] = contextvars.ContextVar(
|
|
60
54
|
"_current_logger", default=None
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tremors
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.2
|
|
4
4
|
Summary: Tremors is a library for logging while collecting metrics.
|
|
5
5
|
Author-email: Narvin Singh <Narvin.A.Singh@gmail.com>
|
|
6
6
|
License: Tremors is a library for logging with metrics.
|
|
@@ -31,9 +31,10 @@ Requires-Python: >=3.12
|
|
|
31
31
|
Description-Content-Type: text/x-rst
|
|
32
32
|
License-File: LICENSE
|
|
33
33
|
Provides-Extra: dev
|
|
34
|
+
Requires-Dist: coverage~=7.11; extra == "dev"
|
|
34
35
|
Requires-Dist: mypy~=1.18; extra == "dev"
|
|
35
36
|
Requires-Dist: pre-commit~=4.3; extra == "dev"
|
|
36
|
-
Requires-Dist: pytest~=
|
|
37
|
+
Requires-Dist: pytest~=9.0; extra == "dev"
|
|
37
38
|
Requires-Dist: ruff~=0.14.2; extra == "dev"
|
|
38
39
|
Requires-Dist: sphinx-lint~=1.0; extra == "dev"
|
|
39
40
|
Requires-Dist: yamllint~=1.37; extra == "dev"
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
tremors/__init__.py,sha256=ItRSJUpZAT6nqa80ROv7wuHxuBDobkGt-mC7zqjwr2Q,300
|
|
2
|
+
tremors/collector.py,sha256=QbZhV8nZcgqJl5Q9ZRrQVvFTVZwl2sp0iX_7usdb71k,18390
|
|
3
|
+
tremors/decorator.py,sha256=O1QRp4rjJeh6zkgbwylaIUu4LNkiRvEp6rRls1GKWXU,3651
|
|
4
|
+
tremors/logger.py,sha256=67Gjez-fRFIYz_Z27NcRqACCZI_wV3lHjDaTyg_FRDc,12457
|
|
5
|
+
tremors/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
+
tremors-0.4.2.dist-info/licenses/LICENSE,sha256=X__qS-gpV601TSYqaoqkV5YKHLJlfyJ1IHbjOJbdXCw,694
|
|
7
|
+
tremors-0.4.2.dist-info/METADATA,sha256=KqcAmh5fu70neO9Sdf2Cdc-nXL5CPpeGj-6Y8KCW5DU,9869
|
|
8
|
+
tremors-0.4.2.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
9
|
+
tremors-0.4.2.dist-info/top_level.txt,sha256=j9lADjMU0C4UHY94-9FAQD7MHtuGDzZgSxtl_iN2kDI,8
|
|
10
|
+
tremors-0.4.2.dist-info/RECORD,,
|
tremors-0.4.0.dist-info/RECORD
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
tremors/__init__.py,sha256=O_T_I0E105fnpKsuLIJncFRuzDR66qojUUFLAVthTiE,300
|
|
2
|
-
tremors/collector.py,sha256=ThaFhfh6kpIxauvlRJUi9iEzKcj_lVFJb62PNzAR654,18557
|
|
3
|
-
tremors/decorator.py,sha256=nWHwwdQBIRBU9j-zxMApLWVkqP6lrLte1-dOLhY4INY,3741
|
|
4
|
-
tremors/logger.py,sha256=kqeDEUfwVwCYgLLfftLH63onnVnVz4a7BFhNzw_36XU,12626
|
|
5
|
-
tremors/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
-
tremors-0.4.0.dist-info/licenses/LICENSE,sha256=X__qS-gpV601TSYqaoqkV5YKHLJlfyJ1IHbjOJbdXCw,694
|
|
7
|
-
tremors-0.4.0.dist-info/METADATA,sha256=ffaGA4qoNXPPm2ZfVryqmqdM67oS7xOeE_CZQ7CbvcQ,9823
|
|
8
|
-
tremors-0.4.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
9
|
-
tremors-0.4.0.dist-info/top_level.txt,sha256=j9lADjMU0C4UHY94-9FAQD7MHtuGDzZgSxtl_iN2kDI,8
|
|
10
|
-
tremors-0.4.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|