Update dependency python_json_logger to v3
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| python_json_logger | ~=2.0.4 -> ~=3.3.0 |
Release Notes
nhairs/python-json-logger (python_json_logger)
v3.3.0: 3.3.0
Added
-
exc_info_as_arrayandstack_info_as_arrayoptions are added topythonjsonlogger.core.BaseJsonFormatterallowing both to be encoded as list of lines instead of a single multi-line string. #35
Security
- Remove
msgspec-python313-prefromdevdependencies preventing potential RCE. Details: GHSA-wmxh-pxcx-9w24
Thanks @1hakusai1 and @omnigodz
v3.2.1: 3.2.1
Fixed
- Import error on
import pythonjsonlogger.jsonlogger#29
v3.2.0: 3.2.0
Changed
-
pythonjsonlogger.[ORJSON,MSGSPEC]_AVAILABLEno longer imports the respective package when determining availability. -
pythonjsonlogger.[orjson,msgspec]now throws apythonjsonlogger.exception.MissingPackageErrorwhen required libraries are not available. These contain more information about what is missing whilst still being anImportError. -
defaultsparameter is no longer ignored and now conforms to the standard library. Setting a defaults dictionary will add the specified keys if the those keys do not exist in a record or weren't passed by theextraparameter when logging a message. -
typing_extensionsis only installed on Python version < 3.10. - Support Python 3.13
-
msgspechas only been tested against pre-release versions.
-
Thanks @cjwatson and @bharel
v3.1.0
This splits common funcitonality out to allow supporting other JSON encoders. Although this is a large refactor, backwards compatibility has been maintained.
Added
-
pythonjsonlogger.core- more details below. -
pythonjsonlogger.defaultsmodule that provides many functions for handling unsupported types. - Orjson encoder support via
pythonjsonlogger.orjson.OrjsonFormatterwith the following additions:- bytes are URL safe base64 encoded.
- Exceptions are "pretty printed" using the exception name and message e.g.
"ValueError: bad value passed" - Enum values use their value, Enum classes now return all values as a list.
- Tracebacks are supported
- Classes (aka types) are support
- Will fallback on
__str__if available, else__repr__if available, else will use__could_not_encode__
- MsgSpec encoder support via
pythonjsonlogger.msgspec.MsgspecFormatterwith the following additions:- Exceptions are "pretty printed" using the exception name and message e.g.
"ValueError: bad value passed" - Enum classes now return all values as a list.
- Tracebacks are supported
- Classes (aka types) are support
- Will fallback on
__str__if available, else__repr__if available, else will use__could_not_encode__ - Note: msgspec only supprts enum values of type
intorstrjcrist/msgspec#680
- Exceptions are "pretty printed" using the exception name and message e.g.
Changed
-
pythonjsonlogger.jsonloggerhas been moved topythonjsonlogger.jsonwith core functionality moved topythonjsonlogger.core. -
pythonjsonlogger.core.BaseJsonFormatterproperly supports alllogging.Formatterarguments:-
fmtis unchanged. -
datefmtis unchanged. -
stylecan now support non-standard arguments by settingvalidatetoFalse -
validateallows non-standardstylearguments or prevents callingvalidateon standardstylearguments. -
defaultis ignored.
-
-
pythonjsonlogger.json.JsonFormatterdefault encodings changed:- bytes are URL safe base64 encoded.
- Exception formatting detected using
BaseExceptioninstead ofException. Now "pretty prints" the exception using the exception name and message e.g."ValueError: bad value passed" - Dataclasses are now supported
- Enum values now use their value, Enum classes now return all values as a list.
- Will fallback on
__str__if available, else__repr__if available, else will use__could_not_encode__
- Renaming fields now preserves order (#7) and ignores missing fields (#6).
- Documentation
- Generated documentation using
mkdocsis stored indocs/ - Documentation within
README.mdhas been moved todocs/index.mdanddocs/qucikstart.md. -
CHANGELOG.mdhas been moved todocs/change-log.md -
SECURITY.mdhas been moved and replaced with a symbolic link todocs/security.md.
- Generated documentation using
Deprecated
-
pythonjsonlogger.jsonloggeris nowpythonjsonlogger.json -
pythonjsonlogger.jsonlogger.RESERVED_ATTRSis nowpythonjsonlogger.core.RESERVED_ATTRS. -
pythonjsonlogger.jsonlogger.merge_record_extrais nowpythonjsonlogger.core.merge_record_extra.
Removed
- Python 3.7 support dropped
-
pythonjsonlogger.jsonlogger.JsonFormatter._str_to_fnreplaced withpythonjsonlogger.core.str_to_object.
v3.0.1
Fixes
- Fix spelling of parameter
json_serialiser->json_serializer(#8) - @juliangilbey
v3.0.0
Note: using new major version to separate changes from this fork and the original (upstream). See #1 for details.
Changes
- Update supported Python versions - @nhairs
- Drop 3.6
- The following versions are supported and tested:
- CPython 3.7-3.12 (ubuntu, windows, mac)
- PyPy 3.7-3.10 (ubuntu, wundows, mac)
-
RESERVED_ATTRSis now a list and version dependent
- Fix
JsonFormatter.__init__return type (None) - @nhairs - Moved to
pyproject.toml- @nhairs - Update linting and testing - @nhairs
- Split lint and test steps in GHA
- Use validate-pyproject, black, pylint, mypy
New Contributors
Full Changelog: https://github.com/nhairs/python-json-logger/compare/v2.0.7...v3.0.0
Configuration
📅 Schedule: Branch creation - "after 10pm every weekday,every weekend,before 5am every weekday" in timezone Europe/Paris, Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
- [ ] If you want to rebase/retry this PR, check this box
This PR was generated by Mend Renovate. View the repository job log.