python3-commons 0.3.15__py2.py3-none-any.whl → 0.3.16__py2.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.
Potentially problematic release.
This version of python3-commons might be problematic. Click here for more details.
- python3_commons/logging/formatter.py +7 -0
- {python3_commons-0.3.15.dist-info → python3_commons-0.3.16.dist-info}/METADATA +1 -1
- {python3_commons-0.3.15.dist-info → python3_commons-0.3.16.dist-info}/RECORD +7 -7
- {python3_commons-0.3.15.dist-info → python3_commons-0.3.16.dist-info}/AUTHORS.rst +0 -0
- {python3_commons-0.3.15.dist-info → python3_commons-0.3.16.dist-info}/LICENSE +0 -0
- {python3_commons-0.3.15.dist-info → python3_commons-0.3.16.dist-info}/WHEEL +0 -0
- {python3_commons-0.3.15.dist-info → python3_commons-0.3.16.dist-info}/top_level.txt +0 -0
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
import json
|
|
2
2
|
import logging
|
|
3
3
|
import traceback
|
|
4
|
+
from contextvars import ContextVar
|
|
4
5
|
|
|
5
6
|
from python3_commons.serializers.json import CustomJSONEncoder
|
|
6
7
|
|
|
7
8
|
|
|
9
|
+
correlation_id: ContextVar[str | None] = ContextVar('correlation_id', default=None)
|
|
10
|
+
|
|
11
|
+
|
|
8
12
|
class JSONFormatter(logging.Formatter):
|
|
9
13
|
@staticmethod
|
|
10
14
|
def format_exception(exc_info):
|
|
11
15
|
return ''.join(traceback.format_exception(*exc_info))
|
|
12
16
|
|
|
13
17
|
def format(self, record):
|
|
18
|
+
if corr_id := correlation_id.get():
|
|
19
|
+
record.correlation_id = corr_id
|
|
20
|
+
|
|
14
21
|
if record.exc_info:
|
|
15
22
|
record.exc_text = self.format_exception(record.exc_info)
|
|
16
23
|
else:
|
|
@@ -7,14 +7,14 @@ python3_commons/minio.py,sha256=0WzxmfKEahxjlC2EdMC8mqy1UZTe2uv9bj1US_IqIoQ,819
|
|
|
7
7
|
python3_commons/object_storage.py,sha256=ka2EIPRNyFx1N2evr7VZPCOaroXzbgYJAUIPlMTuoNY,3644
|
|
8
8
|
python3_commons/logging/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
9
|
python3_commons/logging/filters.py,sha256=fuyjXZAUm-i2MNrxvFYag8F8Rr27x8W8MdV3ke6miSs,175
|
|
10
|
-
python3_commons/logging/formatter.py,sha256=
|
|
10
|
+
python3_commons/logging/formatter.py,sha256=UXmmh1yd5Kc2dpvSHn6uCWLDWE2LMjlYAaH8cg3siV4,720
|
|
11
11
|
python3_commons/serializers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
12
|
python3_commons/serializers/json.py,sha256=P288wWz9ic38QWEMrpp_uwKPYkQiOgvE1cI4WZn6ZCg,808
|
|
13
13
|
python3_commons/serializers/msgpack.py,sha256=P7CZoRTBeDtgALT5GTOZVCNM_3snOfCnfh5S3zcCIEY,1679
|
|
14
14
|
python3_commons/serializers/msgspec.py,sha256=ZrfQWBz_67t3yjU_S6avnRJZzYN-HFzef2qGB5W21KI,2023
|
|
15
|
-
python3_commons-0.3.
|
|
16
|
-
python3_commons-0.3.
|
|
17
|
-
python3_commons-0.3.
|
|
18
|
-
python3_commons-0.3.
|
|
19
|
-
python3_commons-0.3.
|
|
20
|
-
python3_commons-0.3.
|
|
15
|
+
python3_commons-0.3.16.dist-info/AUTHORS.rst,sha256=3R9JnfjfjH5RoPWOeqKFJgxVShSSfzQPIrEr1nxIo9Q,90
|
|
16
|
+
python3_commons-0.3.16.dist-info/LICENSE,sha256=xxILuojHm4fKQOrMHPSslbyy6WuKAN2RiG74HbrYfzM,34575
|
|
17
|
+
python3_commons-0.3.16.dist-info/METADATA,sha256=uMIjt-gpUlrx5dS_mpsCxR7cE5Gndx2FB7Rjzc041z8,919
|
|
18
|
+
python3_commons-0.3.16.dist-info/WHEEL,sha256=DZajD4pwLWue70CAfc7YaxT1wLUciNBvN_TTcvXpltE,110
|
|
19
|
+
python3_commons-0.3.16.dist-info/top_level.txt,sha256=lJI6sCBf68eUHzupCnn2dzG10lH3jJKTWM_hrN1cQ7M,16
|
|
20
|
+
python3_commons-0.3.16.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|