python3-commons 0.16.2__py3-none-any.whl → 0.16.3__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.
@@ -36,7 +36,6 @@ _STD_LOG_FIELDS: Final[frozenset[str]] = frozenset(
36
36
  )
37
37
 
38
38
 
39
- # Keep normalization minimal and branch-based (unchanged)
40
39
  def _normalize(v: Any) -> Any:
41
40
  if isinstance(v, datetime | date):
42
41
  return v.isoformat()
@@ -57,11 +56,11 @@ class JSONFormatter(logging.Formatter):
57
56
  __slots__ = ('_get_correlation_id', '_max_tb_chars', '_encoder')
58
57
 
59
58
  def __init__(
60
- self,
61
- *,
62
- get_correlation_id: Callable[[], str | None] = lambda: correlation_id.get(),
63
- max_exc_tb_chars: int = _DEFAULT_MAX_TB_CHARS,
64
- **kwargs: Any,
59
+ self,
60
+ *,
61
+ get_correlation_id: Callable[[], str | None] = lambda: correlation_id.get(),
62
+ max_exc_tb_chars: int = _DEFAULT_MAX_TB_CHARS,
63
+ **kwargs: Any,
65
64
  ) -> None:
66
65
  super().__init__(**kwargs)
67
66
 
@@ -70,22 +69,12 @@ class JSONFormatter(logging.Formatter):
70
69
  self._encoder = msgspec.json.Encoder()
71
70
 
72
71
  def format(self, record: logging.LogRecord) -> str:
73
- # -------------------------
74
- # message (fast path)
75
- # -------------------------
76
72
  try:
77
73
  message = record.getMessage()
78
74
  except Exception:
79
75
  message = str(record.msg)
80
76
 
81
- # -------------------------
82
- # timestamp (no Formatter overhead)
83
- # -------------------------
84
77
  timestamp = datetime.fromtimestamp(record.created, UTC).isoformat().replace('+00:00', 'Z')
85
-
86
- # -------------------------
87
- # base log object (plain dict)
88
- # -------------------------
89
78
  log: dict[str, Any] = {
90
79
  'message': message,
91
80
  'level': record.levelname,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python3-commons
3
- Version: 0.16.2
3
+ Version: 0.16.3
4
4
  Summary: Re-usable Python3 code
5
5
  Author-email: Oleg Korsak <kamikaze.is.waiting.you@gmail.com>
6
6
  License-Expression: GPL-3.0
@@ -20,15 +20,15 @@ python3_commons/db/models/rbac.py,sha256=ARRQ1tn_GThxiBiIs_6IKkGnIIv37SmVgSi90cb
20
20
  python3_commons/db/models/users.py,sha256=zNN3bNWl3cVE6dJtTPzmPSo_5d1SsBZwwkvIs-WzUBA,644
21
21
  python3_commons/log/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
22
  python3_commons/log/filters.py,sha256=fuyjXZAUm-i2MNrxvFYag8F8Rr27x8W8MdV3ke6miSs,175
23
- python3_commons/log/formatters.py,sha256=uFZit5Xl7k2_hAVjqVG8-6nwFR3C7fKoeuW2jiz2S8M,3496
23
+ python3_commons/log/formatters.py,sha256=mSDnEXIrokcfNhUbUA4GB53zDDCsEs0cwvYqKeg4syY,3128
24
24
  python3_commons/serializers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
25
  python3_commons/serializers/common.py,sha256=VkA7C6wODvHk0QBXVX_x2JieDstihx3U__UFbTYf654,120
26
26
  python3_commons/serializers/json.py,sha256=UPkC3ps13x2C_NxwVV-K7Ewp4VjkVHSSUkJVw5k7Wiw,712
27
27
  python3_commons/serializers/msgpack.py,sha256=zESFBX34GsZ8rDu6Zk5V6CLT6P0mPilU0r04Ka6TblI,1474
28
28
  python3_commons/serializers/msgspec.py,sha256=upy5CBmK66-8hYnK5bAM_sZvZY5CAqZmzCw9GIF346I,2988
29
- python3_commons-0.16.2.dist-info/licenses/AUTHORS.rst,sha256=3R9JnfjfjH5RoPWOeqKFJgxVShSSfzQPIrEr1nxIo9Q,90
30
- python3_commons-0.16.2.dist-info/licenses/LICENSE,sha256=xxILuojHm4fKQOrMHPSslbyy6WuKAN2RiG74HbrYfzM,34575
31
- python3_commons-0.16.2.dist-info/METADATA,sha256=VHzo-ZDsPUIiAdIK3N2CHiOkc6EvdUgsSUjB6yAHBTc,1021
32
- python3_commons-0.16.2.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
33
- python3_commons-0.16.2.dist-info/top_level.txt,sha256=lJI6sCBf68eUHzupCnn2dzG10lH3jJKTWM_hrN1cQ7M,16
34
- python3_commons-0.16.2.dist-info/RECORD,,
29
+ python3_commons-0.16.3.dist-info/licenses/AUTHORS.rst,sha256=3R9JnfjfjH5RoPWOeqKFJgxVShSSfzQPIrEr1nxIo9Q,90
30
+ python3_commons-0.16.3.dist-info/licenses/LICENSE,sha256=xxILuojHm4fKQOrMHPSslbyy6WuKAN2RiG74HbrYfzM,34575
31
+ python3_commons-0.16.3.dist-info/METADATA,sha256=9PYgnQw8bHihX4XvtmnX9WpQlSrTCB7Uh0S5bTO06ik,1021
32
+ python3_commons-0.16.3.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
33
+ python3_commons-0.16.3.dist-info/top_level.txt,sha256=lJI6sCBf68eUHzupCnn2dzG10lH3jJKTWM_hrN1cQ7M,16
34
+ python3_commons-0.16.3.dist-info/RECORD,,