-
Notifications
You must be signed in to change notification settings - Fork 10
Permalink
Choose a base ref
{{ refName }}
default
Choose a head ref
{{ refName }}
default
Comparing changes
Choose two branches to see what’s changed or to start a new pull request.
If you need to, you can also or
learn more about diff comparisons.
Open a pull request
Create a new pull request by comparing changes across two branches. If you need to, you can also .
Learn more about diff comparisons here.
base repository: nhairs/python-json-logger
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.0.1
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
...
head repository: nhairs/python-json-logger
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3.1.0
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
- 8 commits
- 27 files changed
- 1 contributor
Commits on Apr 1, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 2767589 - Browse repository at this point
Copy the full SHA 2767589View commit details
Commits on May 5, 2024
-
Split core functionality and support orjson and msgspec (#9)
## Summary of changes ### Refactor common functionality into base module This allows support multiple JSON encoders by having common functionality in `pythonjsonlogger.core` and then specialist formatters for each encoder. This is useful / needed, as not all JSON encoders support the `json.dumps` or `json.JSONEncoder` interfaces exactly. This enables us to support other JSON encoders like orjson and msgspec. In the future we may add support for other encoders. ### Better handling for custom styles Achieved by mimicking `logging.Formatter.__init__` without actually calling it. A code snippet is worth `2**10` words: ```python from pythonjsonlogger.core import BaseJsonLogger class CommaSupport(BaseJsonFormatter): def parse(self) -> list[str]: if isinstance(self._style, str) and self._style == ",": return self._fmt.split(",") return super().parse() f = CommaSupport("message,asctime", style=",", validate=False) ``` ### Rename `jsonlogger` module to `json` module Compatibility is maintained for the moment using `__getattr__` in `__init__`. This is to enable more consistent naming of implementation specific module names. It also stops throwing around the word "logger" when this module only contains formatters. ### Add support for orjson [orjson](https://github.com/ijl/orjson) is a high performance (and more JSON spec correct) encoder. Given how many logging calls may occur - having a performant formatter available is important. This includes ensuring it is covered in tests on appropriate platforms. Note: orjson is not supported on pypy, and currently does not build for py313. ### Add support for msgspec [msgspec](https://jcristharif.com/msgspec/index.html) is another library containing a high performance JSON encoder. Note: msgspec is not supported on pypy, and currently does not build for py313. ### Drops python 3.7 support This is primary due do making use of the [`validate`](https://docs.python.org/3/library/logging.html#formatter-objects) argument. I was also having issues with CI because python 3.7 is not support on most "latest"
1Configuration menu - View commit details
-
Copy full SHA for 49f69fb - Browse repository at this point
Copy the full SHA 49f69fbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 390b356 - Browse repository at this point
Copy the full SHA 390b356View commit details -
Add tests for common types (#11)
This PR adds tests for common types to ensure that they are being encoded
Configuration menu - View commit details
-
Copy full SHA for 59439e9 - Browse repository at this point
Copy the full SHA 59439e9View commit details
Commits on May 14, 2024
-
Improve non-standard type encoding (#12)
This PR improves the JSON encoding of non-standard types by introducing and using the `.defaults` module. The `.defaults` module adds helper functions that can test and apply formatting for types not supported by a given encoder. Please note that in doing so, some outputs of the `JsonFormatter` have changed. That said these changes return more "reasonable" results rather the the original `str(o)` fallback. For more detailed list of changes to the encoders see the CHANGELOG. ## Test Plan Have added additional tests and now check for specific output.
Configuration menu - View commit details
-
Copy full SHA for b37c54b - Browse repository at this point
Copy the full SHA b37c54bView commit details
Commits on May 18, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 1160ae8 - Browse repository at this point
Copy the full SHA 1160ae8View commit details
Commits on May 28, 2024
-
Move documentation to mkdocs (#14)
This pull request moves the existing documentation to `mkdocs` for generation. This includes setting links for use with GitHub Pages. ## Test Plan View the docs locally using `mkdocs serve`.
1Configuration menu - View commit details
-
Copy full SHA for 42107cd - Browse repository at this point
Copy the full SHA 42107cdView commit details -
Configuration menu - View commit details
-
Copy full SHA for e2b40e4 - Browse repository at this point
Copy the full SHA e2b40e4View commit details
Loading
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff v3.0.1...v3.1.0