python3-commons 0.3.14__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.

@@ -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:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python3-commons
3
- Version: 0.3.14
3
+ Version: 0.3.16
4
4
  Summary: Re-usable Python3 code
5
5
  Home-page: https://github.com/kamikaze/python3-commons
6
6
  Author: Oleg Korsak
@@ -18,7 +18,7 @@ Requires-Dist: asyncpg ==0.29.0
18
18
  Requires-Dist: minio ==7.2.5
19
19
  Requires-Dist: msgpack ==1.0.8
20
20
  Requires-Dist: msgspec ==0.18.6
21
- Requires-Dist: pydantic[email] ==2.6.3
21
+ Requires-Dist: pydantic[email] ==2.6.4
22
22
  Requires-Dist: pydantic-settings ==2.2.1
23
23
  Provides-Extra: testing
24
24
  Requires-Dist: pytest ; extra == 'testing'
@@ -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=bG5PrmD_5D_3Xk8x-wvtcnhXiLRSV8DkEF22tQCtXUA,510
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.14.dist-info/AUTHORS.rst,sha256=3R9JnfjfjH5RoPWOeqKFJgxVShSSfzQPIrEr1nxIo9Q,90
16
- python3_commons-0.3.14.dist-info/LICENSE,sha256=xxILuojHm4fKQOrMHPSslbyy6WuKAN2RiG74HbrYfzM,34575
17
- python3_commons-0.3.14.dist-info/METADATA,sha256=Rq9d7hyCRndmUuo4KWX3RzQaTwgeCbuiKwLiAsqTAT8,919
18
- python3_commons-0.3.14.dist-info/WHEEL,sha256=-G_t0oGuE7UD0DrSpVZnq1hHMBV9DD2XkS5v7XpmTnk,110
19
- python3_commons-0.3.14.dist-info/top_level.txt,sha256=lJI6sCBf68eUHzupCnn2dzG10lH3jJKTWM_hrN1cQ7M,16
20
- python3_commons-0.3.14.dist-info/RECORD,,
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,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.42.0)
2
+ Generator: bdist_wheel (0.43.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py2-none-any
5
5
  Tag: py3-none-any