risclog.logging 2.2.0__tar.gz → 2.2.2__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.
- risclog.logging-2.2.2/.github/ISSUE_TEMPLATE.md +15 -0
- risclog.logging-2.2.2/.github/workflows/test.yml +42 -0
- risclog.logging-2.2.2/.gitignore +110 -0
- {risclog.logging-2.2.0 → risclog.logging-2.2.2}/CHANGES.rst +12 -0
- {risclog.logging-2.2.0 → risclog.logging-2.2.2}/PKG-INFO +14 -1
- {risclog.logging-2.2.0 → risclog.logging-2.2.2}/setup.py +2 -1
- {risclog.logging-2.2.0 → risclog.logging-2.2.2}/src/risclog/logging/__init__.py +4 -5
- {risclog.logging-2.2.0 → risclog.logging-2.2.2}/src/risclog/logging/decorators.py +27 -6
- {risclog.logging-2.2.0 → risclog.logging-2.2.2}/src/risclog/logging/log.py +2 -2
- {risclog.logging-2.2.0 → risclog.logging-2.2.2}/src/risclog.logging.egg-info/PKG-INFO +14 -1
- {risclog.logging-2.2.0 → risclog.logging-2.2.2}/src/risclog.logging.egg-info/SOURCES.txt +3 -0
- {risclog.logging-2.2.0 → risclog.logging-2.2.2}/src/risclog.logging.egg-info/requires.txt +1 -0
- {risclog.logging-2.2.0 → risclog.logging-2.2.2}/AUTHORS.rst +0 -0
- {risclog.logging-2.2.0 → risclog.logging-2.2.2}/CONTRIBUTING.rst +0 -0
- {risclog.logging-2.2.0 → risclog.logging-2.2.2}/LICENSE +0 -0
- {risclog.logging-2.2.0 → risclog.logging-2.2.2}/MANIFEST.in +0 -0
- {risclog.logging-2.2.0 → risclog.logging-2.2.2}/Makefile +0 -0
- {risclog.logging-2.2.0 → risclog.logging-2.2.2}/README.rst +0 -0
- {risclog.logging-2.2.0 → risclog.logging-2.2.2}/docs/Makefile +0 -0
- {risclog.logging-2.2.0 → risclog.logging-2.2.2}/docs/authors.rst +0 -0
- {risclog.logging-2.2.0 → risclog.logging-2.2.2}/docs/conf.py +0 -0
- {risclog.logging-2.2.0 → risclog.logging-2.2.2}/docs/contributing.rst +0 -0
- {risclog.logging-2.2.0 → risclog.logging-2.2.2}/docs/history.rst +0 -0
- {risclog.logging-2.2.0 → risclog.logging-2.2.2}/docs/index.rst +0 -0
- {risclog.logging-2.2.0 → risclog.logging-2.2.2}/docs/installation.rst +0 -0
- {risclog.logging-2.2.0 → risclog.logging-2.2.2}/docs/make.bat +0 -0
- {risclog.logging-2.2.0 → risclog.logging-2.2.2}/docs/readme.rst +0 -0
- {risclog.logging-2.2.0 → risclog.logging-2.2.2}/docs/usage.rst +0 -0
- {risclog.logging-2.2.0 → risclog.logging-2.2.2}/mypy.ini +0 -0
- {risclog.logging-2.2.0 → risclog.logging-2.2.2}/pyproject.toml +0 -0
- {risclog.logging-2.2.0 → risclog.logging-2.2.2}/scripts/all_in_one.py +0 -0
- {risclog.logging-2.2.0 → risclog.logging-2.2.2}/scripts/api.py +0 -0
- {risclog.logging-2.2.0 → risclog.logging-2.2.2}/scripts/simple_test.py +0 -0
- {risclog.logging-2.2.0 → risclog.logging-2.2.2}/scripts/test_logger.py +0 -0
- {risclog.logging-2.2.0 → risclog.logging-2.2.2}/setup.cfg +0 -0
- {risclog.logging-2.2.0 → risclog.logging-2.2.2}/src/risclog/__init__.py +0 -0
- {risclog.logging-2.2.0 → risclog.logging-2.2.2}/src/risclog/logging/conftest.py +0 -0
- {risclog.logging-2.2.0 → risclog.logging-2.2.2}/src/risclog/logging/py.typed +0 -0
- {risclog.logging-2.2.0 → risclog.logging-2.2.2}/src/risclog/logging/sender.py +0 -0
- {risclog.logging-2.2.0 → risclog.logging-2.2.2}/src/risclog/logging/tests/__init__.py +0 -0
- {risclog.logging-2.2.0 → risclog.logging-2.2.2}/src/risclog/logging/tests/test_logger.py +0 -0
- {risclog.logging-2.2.0 → risclog.logging-2.2.2}/src/risclog/logging/tests/test_sender.py +0 -0
- {risclog.logging-2.2.0 → risclog.logging-2.2.2}/src/risclog.logging.egg-info/dependency_links.txt +0 -0
- {risclog.logging-2.2.0 → risclog.logging-2.2.2}/src/risclog.logging.egg-info/namespace_packages.txt +0 -0
- {risclog.logging-2.2.0 → risclog.logging-2.2.2}/src/risclog.logging.egg-info/not-zip-safe +0 -0
- {risclog.logging-2.2.0 → risclog.logging-2.2.2}/src/risclog.logging.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
* risclog.logging version:
|
|
2
|
+
* Python version:
|
|
3
|
+
* Operating System:
|
|
4
|
+
|
|
5
|
+
### Description
|
|
6
|
+
|
|
7
|
+
Describe what you were trying to get done.
|
|
8
|
+
Tell us what happened, what went wrong, and what you expected to happen.
|
|
9
|
+
|
|
10
|
+
### What I Did
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
Paste the command(s) you ran and the output.
|
|
14
|
+
If there was a crash, please include the traceback here.
|
|
15
|
+
```
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
name: Test
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
push:
|
|
6
|
+
branches:
|
|
7
|
+
- master
|
|
8
|
+
- testing
|
|
9
|
+
pull_request:
|
|
10
|
+
schedule:
|
|
11
|
+
# * is a special character in YAML so you have to quote this string
|
|
12
|
+
- cron: '0 2 * * *'
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
test:
|
|
16
|
+
uses: risclog-solution/gha_workflow_templates/.github/workflows/pytest_appenv.yml@master
|
|
17
|
+
with:
|
|
18
|
+
versions: >-
|
|
19
|
+
["3.13","3.12"]
|
|
20
|
+
secrets:
|
|
21
|
+
PIPCONF: ${{ secrets.PIPCONF }}
|
|
22
|
+
coverage:
|
|
23
|
+
needs: test
|
|
24
|
+
uses: risclog-solution/gha_workflow_templates/.github/workflows/coverage.yml@master
|
|
25
|
+
with:
|
|
26
|
+
min_coverage: 80
|
|
27
|
+
|
|
28
|
+
pre-commit:
|
|
29
|
+
uses: risclog-solution/gha_workflow_templates/.github/workflows/pre_commit.yml@master
|
|
30
|
+
|
|
31
|
+
sonarqube:
|
|
32
|
+
needs: coverage
|
|
33
|
+
uses: risclog-solution/gha_workflow_templates/.github/workflows/sonarqube.yml@master
|
|
34
|
+
secrets:
|
|
35
|
+
SONARQUBETOKEN: ${{ secrets.SONARQUBETOKEN }}
|
|
36
|
+
|
|
37
|
+
publish-test-results:
|
|
38
|
+
needs: test
|
|
39
|
+
uses: risclog-solution/gha_workflow_templates/.github/workflows/publish_test_results.yml@master
|
|
40
|
+
|
|
41
|
+
cleanup:
|
|
42
|
+
uses: risclog-solution/gha_workflow_templates/.github/workflows/cleanup.yml@master
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
env/
|
|
12
|
+
build/
|
|
13
|
+
develop-eggs/
|
|
14
|
+
dist/
|
|
15
|
+
downloads/
|
|
16
|
+
eggs/
|
|
17
|
+
.eggs/
|
|
18
|
+
lib/
|
|
19
|
+
lib64/
|
|
20
|
+
parts/
|
|
21
|
+
sdist/
|
|
22
|
+
var/
|
|
23
|
+
wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
|
|
28
|
+
# PyInstaller
|
|
29
|
+
# Usually these files are written by a python script from a template
|
|
30
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
31
|
+
*.manifest
|
|
32
|
+
*.spec
|
|
33
|
+
|
|
34
|
+
# Installer logs
|
|
35
|
+
pip-log.txt
|
|
36
|
+
pip-delete-this-directory.txt
|
|
37
|
+
|
|
38
|
+
# Unit test / coverage reports
|
|
39
|
+
htmlcov/
|
|
40
|
+
.tox/
|
|
41
|
+
.coverage
|
|
42
|
+
.coverage.*
|
|
43
|
+
.cache
|
|
44
|
+
nosetests.xml
|
|
45
|
+
coverage.xml
|
|
46
|
+
*.cover
|
|
47
|
+
.hypothesis/
|
|
48
|
+
.pytest_cache/
|
|
49
|
+
|
|
50
|
+
# Translations
|
|
51
|
+
*.mo
|
|
52
|
+
*.pot
|
|
53
|
+
|
|
54
|
+
# Django stuff:
|
|
55
|
+
*.log
|
|
56
|
+
local_settings.py
|
|
57
|
+
|
|
58
|
+
# Flask stuff:
|
|
59
|
+
instance/
|
|
60
|
+
.webassets-cache
|
|
61
|
+
|
|
62
|
+
# Scrapy stuff:
|
|
63
|
+
.scrapy
|
|
64
|
+
|
|
65
|
+
# Sphinx documentation
|
|
66
|
+
docs/_build/
|
|
67
|
+
|
|
68
|
+
# PyBuilder
|
|
69
|
+
target/
|
|
70
|
+
|
|
71
|
+
# Jupyter Notebook
|
|
72
|
+
.ipynb_checkpoints
|
|
73
|
+
|
|
74
|
+
# pyenv
|
|
75
|
+
.python-version
|
|
76
|
+
|
|
77
|
+
# celery beat schedule file
|
|
78
|
+
celerybeat-schedule
|
|
79
|
+
|
|
80
|
+
# SageMath parsed files
|
|
81
|
+
*.sage.py
|
|
82
|
+
|
|
83
|
+
# virtualenv
|
|
84
|
+
.venv
|
|
85
|
+
venv/
|
|
86
|
+
ENV/
|
|
87
|
+
|
|
88
|
+
# Spyder project settings
|
|
89
|
+
.spyderproject
|
|
90
|
+
.spyproject
|
|
91
|
+
|
|
92
|
+
# Rope project settings
|
|
93
|
+
.ropeproject
|
|
94
|
+
|
|
95
|
+
# mkdocs documentation
|
|
96
|
+
/site
|
|
97
|
+
|
|
98
|
+
# mypy
|
|
99
|
+
.mypy_cache/
|
|
100
|
+
|
|
101
|
+
# IDE settings
|
|
102
|
+
.vscode/
|
|
103
|
+
.idea/
|
|
104
|
+
|
|
105
|
+
# AppEnv specific
|
|
106
|
+
.appenv/
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
.DS_Store
|
|
110
|
+
.vendor/
|
|
@@ -3,6 +3,18 @@ Change log for risclog.logging
|
|
|
3
3
|
==============================
|
|
4
4
|
|
|
5
5
|
|
|
6
|
+
2.2.2 (2026-04-13)
|
|
7
|
+
==================
|
|
8
|
+
|
|
9
|
+
- fix: Fix log_decorator type hints
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
2.2.1 (2026-02-27)
|
|
13
|
+
==================
|
|
14
|
+
|
|
15
|
+
- Allow reconfiguring structlog after first initialization.
|
|
16
|
+
|
|
17
|
+
|
|
6
18
|
2.2.0 (2026-01-29)
|
|
7
19
|
==================
|
|
8
20
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: risclog.logging
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.2
|
|
4
4
|
Summary: A logger based on structlog
|
|
5
5
|
Home-page: https://github.com/risclog-solution/risclog.logging
|
|
6
6
|
Author: riscLOG Solution GmbH
|
|
@@ -23,6 +23,7 @@ License-File: LICENSE
|
|
|
23
23
|
License-File: AUTHORS.rst
|
|
24
24
|
Requires-Dist: structlog
|
|
25
25
|
Requires-Dist: stamina
|
|
26
|
+
Requires-Dist: typing_extensions
|
|
26
27
|
Provides-Extra: docs
|
|
27
28
|
Requires-Dist: Sphinx; extra == "docs"
|
|
28
29
|
Provides-Extra: test
|
|
@@ -495,6 +496,18 @@ Change log for risclog.logging
|
|
|
495
496
|
==============================
|
|
496
497
|
|
|
497
498
|
|
|
499
|
+
2.2.2 (2026-04-13)
|
|
500
|
+
==================
|
|
501
|
+
|
|
502
|
+
- fix: Fix log_decorator type hints
|
|
503
|
+
|
|
504
|
+
|
|
505
|
+
2.2.1 (2026-02-27)
|
|
506
|
+
==================
|
|
507
|
+
|
|
508
|
+
- Allow reconfiguring structlog after first initialization.
|
|
509
|
+
|
|
510
|
+
|
|
498
511
|
2.2.0 (2026-01-29)
|
|
499
512
|
==================
|
|
500
513
|
|
|
@@ -32,6 +32,7 @@ setup(
|
|
|
32
32
|
# Add your dependencies here
|
|
33
33
|
"structlog",
|
|
34
34
|
"stamina",
|
|
35
|
+
"typing_extensions",
|
|
35
36
|
],
|
|
36
37
|
extras_require={
|
|
37
38
|
"docs": [
|
|
@@ -64,6 +65,6 @@ setup(
|
|
|
64
65
|
namespace_packages=["risclog"],
|
|
65
66
|
package_dir={"": "src"},
|
|
66
67
|
url="https://github.com/risclog-solution/risclog.logging",
|
|
67
|
-
version="2.2.
|
|
68
|
+
version="2.2.2",
|
|
68
69
|
zip_safe=False,
|
|
69
70
|
)
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
from typing import
|
|
1
|
+
from typing import Callable
|
|
2
2
|
|
|
3
|
-
from risclog.logging.decorators import log_decorator
|
|
3
|
+
from risclog.logging.decorators import log_decorator
|
|
4
4
|
from risclog.logging.log import HybridLogger, get_logger as old_get_logger
|
|
5
5
|
from risclog.logging.log import getLogger as logger
|
|
6
6
|
|
|
7
|
-
F = TypeVar("F", bound=Callable[..., Any])
|
|
8
|
-
|
|
9
7
|
getLogger: Callable[[str], HybridLogger] = logger
|
|
10
|
-
log_decorator: Callable[[F], F] = logging_decorator
|
|
11
8
|
|
|
12
9
|
# DeprecationWarning: 'get_logger' is obsolete and will be removed from version 2.1.0. Please use 'getLogger' instead.
|
|
13
10
|
get_logger: Callable[[str], HybridLogger] = old_get_logger
|
|
11
|
+
|
|
12
|
+
__all__ = ["getLogger", "get_logger", "log_decorator"]
|
|
@@ -7,10 +7,15 @@ import traceback
|
|
|
7
7
|
from concurrent.futures import ThreadPoolExecutor
|
|
8
8
|
from functools import partial, wraps
|
|
9
9
|
from pathlib import Path
|
|
10
|
-
from typing import Any
|
|
10
|
+
from typing import Any, Callable, TypeVar, cast, overload
|
|
11
|
+
|
|
12
|
+
from typing_extensions import ParamSpec
|
|
11
13
|
|
|
12
14
|
from risclog.logging.log import HybridLogger, getLogger
|
|
13
15
|
|
|
16
|
+
P = ParamSpec("P")
|
|
17
|
+
R = TypeVar("R")
|
|
18
|
+
|
|
14
19
|
|
|
15
20
|
def exception_to_string(excp: BaseException) -> str:
|
|
16
21
|
stack = traceback.extract_stack()[:-3] + traceback.extract_tb(excp.__traceback__)
|
|
@@ -31,11 +36,27 @@ def format_args(func: Any, args: tuple, kwargs: dict) -> tuple: # type: ignore[
|
|
|
31
36
|
return tuple(formatted_args + formatted_kwargs)
|
|
32
37
|
|
|
33
38
|
|
|
34
|
-
|
|
39
|
+
@overload
|
|
40
|
+
def log_decorator(func: Callable[P, R], send_email: bool = False) -> Callable[P, R]: ...
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
@overload
|
|
44
|
+
def log_decorator(
|
|
45
|
+
func: None = None, send_email: bool = False
|
|
46
|
+
) -> Callable[[Callable[P, R]], Callable[P, R]]: ...
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def log_decorator(
|
|
50
|
+
func: Callable[P, R] | None = None, send_email: bool = False
|
|
51
|
+
) -> Callable[P, R] | Callable[[Callable[P, R]], Callable[P, R]]:
|
|
35
52
|
from risclog.logging.sender import smtp_email_send
|
|
36
53
|
|
|
37
54
|
if func is None:
|
|
38
|
-
|
|
55
|
+
|
|
56
|
+
def _decorator(method: Callable[P, R]) -> Callable[P, R]:
|
|
57
|
+
return log_decorator(method, send_email)
|
|
58
|
+
|
|
59
|
+
return _decorator
|
|
39
60
|
|
|
40
61
|
logger: HybridLogger = getLogger(func.__module__)
|
|
41
62
|
method_id = id(func.__name__)
|
|
@@ -43,7 +64,7 @@ def log_decorator(func=None, send_email=False): # type: ignore[no-untyped-def]
|
|
|
43
64
|
if inspect.iscoroutinefunction(func):
|
|
44
65
|
|
|
45
66
|
@wraps(func)
|
|
46
|
-
async def wrapper(*args, **kwargs
|
|
67
|
+
async def wrapper(*args: P.args, **kwargs: P.kwargs) -> Any:
|
|
47
68
|
if not logging.getLogger(logger.name).isEnabledFor(logging.DEBUG):
|
|
48
69
|
try:
|
|
49
70
|
return await func(*args, **kwargs)
|
|
@@ -108,7 +129,7 @@ def log_decorator(func=None, send_email=False): # type: ignore[no-untyped-def]
|
|
|
108
129
|
else:
|
|
109
130
|
|
|
110
131
|
@wraps(func)
|
|
111
|
-
def wrapper(*args, **kwargs
|
|
132
|
+
def wrapper(*args: P.args, **kwargs: P.kwargs) -> R:
|
|
112
133
|
if not logging.getLogger(logger.name).isEnabledFor(logging.DEBUG):
|
|
113
134
|
try:
|
|
114
135
|
return func(*args, **kwargs)
|
|
@@ -168,4 +189,4 @@ def log_decorator(func=None, send_email=False): # type: ignore[no-untyped-def]
|
|
|
168
189
|
)
|
|
169
190
|
raise
|
|
170
191
|
|
|
171
|
-
return wrapper
|
|
192
|
+
return cast(Callable[P, R], wrapper)
|
|
@@ -101,7 +101,7 @@ structlog.configure(
|
|
|
101
101
|
context_class=dict,
|
|
102
102
|
logger_factory=structlog.stdlib.LoggerFactory(),
|
|
103
103
|
wrapper_class=structlog.stdlib.BoundLogger,
|
|
104
|
-
cache_logger_on_first_use=
|
|
104
|
+
cache_logger_on_first_use=False,
|
|
105
105
|
)
|
|
106
106
|
|
|
107
107
|
|
|
@@ -209,7 +209,7 @@ class HybridLogger:
|
|
|
209
209
|
)
|
|
210
210
|
from risclog.logging import log_decorator
|
|
211
211
|
|
|
212
|
-
return partial(log_decorator, send_email=send_email)
|
|
212
|
+
return partial(log_decorator, send_email=send_email)
|
|
213
213
|
|
|
214
214
|
|
|
215
215
|
# -----------------------------------
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: risclog.logging
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.2
|
|
4
4
|
Summary: A logger based on structlog
|
|
5
5
|
Home-page: https://github.com/risclog-solution/risclog.logging
|
|
6
6
|
Author: riscLOG Solution GmbH
|
|
@@ -23,6 +23,7 @@ License-File: LICENSE
|
|
|
23
23
|
License-File: AUTHORS.rst
|
|
24
24
|
Requires-Dist: structlog
|
|
25
25
|
Requires-Dist: stamina
|
|
26
|
+
Requires-Dist: typing_extensions
|
|
26
27
|
Provides-Extra: docs
|
|
27
28
|
Requires-Dist: Sphinx; extra == "docs"
|
|
28
29
|
Provides-Extra: test
|
|
@@ -495,6 +496,18 @@ Change log for risclog.logging
|
|
|
495
496
|
==============================
|
|
496
497
|
|
|
497
498
|
|
|
499
|
+
2.2.2 (2026-04-13)
|
|
500
|
+
==================
|
|
501
|
+
|
|
502
|
+
- fix: Fix log_decorator type hints
|
|
503
|
+
|
|
504
|
+
|
|
505
|
+
2.2.1 (2026-02-27)
|
|
506
|
+
==================
|
|
507
|
+
|
|
508
|
+
- Allow reconfiguring structlog after first initialization.
|
|
509
|
+
|
|
510
|
+
|
|
498
511
|
2.2.0 (2026-01-29)
|
|
499
512
|
==================
|
|
500
513
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{risclog.logging-2.2.0 → risclog.logging-2.2.2}/src/risclog.logging.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{risclog.logging-2.2.0 → risclog.logging-2.2.2}/src/risclog.logging.egg-info/namespace_packages.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|