python-json-logger 4.3.0.dev3__py3-none-any.whl → 4.3.0rc1__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-json-logger
3
- Version: 4.3.0.dev3
3
+ Version: 4.3.0rc1
4
4
  Summary: JSON Log Formatter for the Python Logging Package
5
5
  Author-email: Zakaria Zajac <zak@madzak.com>, Nicholas Hairs <info+python-json-logger@nicholashairs.com>
6
6
  Maintainer-email: Nicholas Hairs <info+python-json-logger@nicholashairs.com>
@@ -29,7 +29,7 @@ Dynamic: license-file
29
29
  [![PyPI - Downloads](https://img.shields.io/pypi/dm/python-json-logger)](https://pypi.python.org/pypi/python-json-logger/)
30
30
  [![Python Versions](https://img.shields.io/pypi/pyversions/python-json-logger.svg)](https://github.com/nhairs/python-json-logger)
31
31
  [![License](https://img.shields.io/github/license/nhairs/python-json-logger.svg)](https://github.com/nhairs/python-json-logger)
32
- ![Build Status](https://github.com/nhairs/python-json-logger/actions/workflows/test-suite.yml/badge.svg)
32
+ ![Build Status](https://github.com/nhairs/python-json-logger/actions/workflows/ci.yml/badge.svg)
33
33
  #
34
34
  # Python JSON Logger
35
35
 
@@ -1,6 +1,6 @@
1
- python_json_logger-4.3.0.dev3.dist-info/licenses/LICENSE,sha256=GOqVF546Xg4k62zhbED7--IxM8JQKTOi91-KPhoFW1Q,1329
1
+ python_json_logger-4.3.0rc1.dist-info/licenses/LICENSE,sha256=GOqVF546Xg4k62zhbED7--IxM8JQKTOi91-KPhoFW1Q,1329
2
2
  pythonjsonlogger/__init__.py,sha256=2QcveuId10CyXff_BtJ_6kXIarHT5oq66XHHMFiaE8s,419
3
- pythonjsonlogger/core.py,sha256=T02iURAubnMTk0PO0HUOckS93eMfAFapSZcFPXJqB64,17102
3
+ pythonjsonlogger/core.py,sha256=2ebJU0pK7_1UCMLoYJov97IaVJIpJgW5FcNAejKmF8c,17371
4
4
  pythonjsonlogger/defaults.py,sha256=VR_Wl092yRjwS0mREjuNn_W4H4sAjtcZAIYFBMYNHe0,6770
5
5
  pythonjsonlogger/exception.py,sha256=r3DXDk7TThscnMVNPpVRaRSFHTnY-ygea6nn-FgjwsI,804
6
6
  pythonjsonlogger/json.py,sha256=6aJSqd2BeysAHkQkxb7dPgFpqsFRf4rvWYgaWF2MEC0,4064
@@ -9,7 +9,7 @@ pythonjsonlogger/msgspec.py,sha256=tdFes9rLrdns9I_C5ascK9a265iNc4UccLPzc8JbFDI,2
9
9
  pythonjsonlogger/orjson.py,sha256=XWM-jyl6g_40Em8kt188EOspD872xHvYy8aS_CLlssw,2354
10
10
  pythonjsonlogger/py.typed,sha256=4RLptUHQuSqzK6CDbigff8uvWQjwPPQMxikWPkV4OtA,80
11
11
  pythonjsonlogger/utils.py,sha256=qr04nb61TkVw7cJTXAtLBfyH_NBvyYUlR_mehH76-RM,1126
12
- python_json_logger-4.3.0.dev3.dist-info/METADATA,sha256=yXN6NYfMFuAnDZvWByXwJlkTJRRd7Cp2vwKfPYEDd8M,2922
13
- python_json_logger-4.3.0.dev3.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
14
- python_json_logger-4.3.0.dev3.dist-info/top_level.txt,sha256=9G-OsTkbwPgM8t-bXKPmWDBRZv9cbzLIiEDE5EnGk2I,17
15
- python_json_logger-4.3.0.dev3.dist-info/RECORD,,
12
+ python_json_logger-4.3.0rc1.dist-info/METADATA,sha256=6DbHFpdhvWPYJalj4ui1afXm7_6ldgQWCF_PxpCwUPQ,2912
13
+ python_json_logger-4.3.0rc1.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
14
+ python_json_logger-4.3.0rc1.dist-info/top_level.txt,sha256=9G-OsTkbwPgM8t-bXKPmWDBRZv9cbzLIiEDE5EnGk2I,17
15
+ python_json_logger-4.3.0rc1.dist-info/RECORD,,
pythonjsonlogger/core.py CHANGED
@@ -98,10 +98,18 @@ def merge_record_extra(
98
98
  """
99
99
  if rename_fields is None:
100
100
  rename_fields = {}
101
- for key, value in record.__dict__.items():
101
+ record_dict = record.__dict__
102
+ for key in record_dict:
103
+ if key in reserved:
104
+ continue
102
105
  # this allows to have numeric keys
103
- if key not in reserved and not (hasattr(key, "startswith") and key.startswith("_")):
104
- target[rename_fields.get(key, key)] = value
106
+ # an exact str check is faster than hasattr() for the common case
107
+ if type(key) is str: # pylint: disable=unidiomatic-typecheck
108
+ if key.startswith("_"):
109
+ continue
110
+ elif hasattr(key, "startswith") and key.startswith("_"):
111
+ continue
112
+ target[rename_fields.get(key, key)] = record_dict[key]
105
113
  return target
106
114
 
107
115