python3-commons 0.16.7__py3-none-any.whl → 0.16.8__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.
- python3_commons/log/formatters.py +8 -7
- {python3_commons-0.16.7.dist-info → python3_commons-0.16.8.dist-info}/METADATA +2 -2
- {python3_commons-0.16.7.dist-info → python3_commons-0.16.8.dist-info}/RECORD +7 -7
- {python3_commons-0.16.7.dist-info → python3_commons-0.16.8.dist-info}/WHEEL +0 -0
- {python3_commons-0.16.7.dist-info → python3_commons-0.16.8.dist-info}/licenses/AUTHORS.rst +0 -0
- {python3_commons-0.16.7.dist-info → python3_commons-0.16.8.dist-info}/licenses/LICENSE +0 -0
- {python3_commons-0.16.7.dist-info → python3_commons-0.16.8.dist-info}/top_level.txt +0 -0
|
@@ -71,7 +71,7 @@ class JSONFormatter(logging.Formatter):
|
|
|
71
71
|
message = str(record.msg)
|
|
72
72
|
|
|
73
73
|
timestamp = datetime.fromtimestamp(record.created, UTC).isoformat().replace('+00:00', 'Z')
|
|
74
|
-
|
|
74
|
+
log_dict: dict[str, Any] = {
|
|
75
75
|
'message': message,
|
|
76
76
|
'level': record.levelname,
|
|
77
77
|
'logger': record.name,
|
|
@@ -81,8 +81,8 @@ class JSONFormatter(logging.Formatter):
|
|
|
81
81
|
if (exc_info := record.exc_info) and exc_info[0] is not None:
|
|
82
82
|
exc_type, exc_value, exc_tb = exc_info
|
|
83
83
|
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
log_dict['exc_type'] = f'{exc_type.__module__}.{exc_type.__qualname__}'
|
|
85
|
+
log_dict['exc_value'] = str(exc_value)
|
|
86
86
|
|
|
87
87
|
tb = ''.join(traceback.format_exception(exc_type, exc_value, exc_tb)).rstrip()
|
|
88
88
|
cap = self._max_tb_chars
|
|
@@ -90,18 +90,19 @@ class JSONFormatter(logging.Formatter):
|
|
|
90
90
|
if cap and len(tb) > cap:
|
|
91
91
|
tb = tb[:cap] + '\n... <truncated>'
|
|
92
92
|
|
|
93
|
-
|
|
93
|
+
log_dict['exc_traceback'] = tb
|
|
94
94
|
|
|
95
95
|
record_dict = record.__dict__
|
|
96
96
|
std_log_fields = _STD_LOG_FIELDS
|
|
97
97
|
|
|
98
98
|
if len(record_dict) > len(std_log_fields):
|
|
99
99
|
normalize = _normalize
|
|
100
|
-
|
|
100
|
+
log_dict_set = log_dict.__setitem__
|
|
101
101
|
|
|
102
102
|
for k, v in record_dict.items():
|
|
103
103
|
if k[0] == '_' or k in std_log_fields:
|
|
104
104
|
continue
|
|
105
|
-
out_set(k, normalize(v))
|
|
106
105
|
|
|
107
|
-
|
|
106
|
+
log_dict_set(k, normalize(v))
|
|
107
|
+
|
|
108
|
+
return self._encoder.encode(log_dict).decode('utf-8')
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python3-commons
|
|
3
|
-
Version: 0.16.
|
|
3
|
+
Version: 0.16.8
|
|
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
|
|
@@ -8,7 +8,7 @@ Project-URL: Homepage, https://github.com/kamikaze/python3-commons
|
|
|
8
8
|
Project-URL: Documentation, https://github.com/kamikaze/python3-commons/wiki
|
|
9
9
|
Classifier: Development Status :: 4 - Beta
|
|
10
10
|
Classifier: Programming Language :: Python
|
|
11
|
-
Requires-Python: <3.15.0,>=3.14.
|
|
11
|
+
Requires-Python: <3.15.0,>=3.14.0
|
|
12
12
|
Description-Content-Type: text/x-rst
|
|
13
13
|
License-File: LICENSE
|
|
14
14
|
License-File: AUTHORS.rst
|
|
@@ -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=
|
|
23
|
+
python3_commons/log/formatters.py,sha256=Z6qlkuvRnmyY1RtvxqoDqQW8j-jdJAligeHzWhYkZ5Y,2784
|
|
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.
|
|
30
|
-
python3_commons-0.16.
|
|
31
|
-
python3_commons-0.16.
|
|
32
|
-
python3_commons-0.16.
|
|
33
|
-
python3_commons-0.16.
|
|
34
|
-
python3_commons-0.16.
|
|
29
|
+
python3_commons-0.16.8.dist-info/licenses/AUTHORS.rst,sha256=3R9JnfjfjH5RoPWOeqKFJgxVShSSfzQPIrEr1nxIo9Q,90
|
|
30
|
+
python3_commons-0.16.8.dist-info/licenses/LICENSE,sha256=xxILuojHm4fKQOrMHPSslbyy6WuKAN2RiG74HbrYfzM,34575
|
|
31
|
+
python3_commons-0.16.8.dist-info/METADATA,sha256=LoXjgb_Slx7fPvzH1MIn_HV30rH5vdeXQri-asZAhL0,1021
|
|
32
|
+
python3_commons-0.16.8.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
33
|
+
python3_commons-0.16.8.dist-info/top_level.txt,sha256=lJI6sCBf68eUHzupCnn2dzG10lH3jJKTWM_hrN1cQ7M,16
|
|
34
|
+
python3_commons-0.16.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|