Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add options to encode stack information into an array #39

Merged
merged 12 commits into from
Feb 4, 2025

Conversation

1hakusai1
Copy link
Contributor

@1hakusai1 1hakusai1 commented Jan 5, 2025

close #35

This PR add options to encode stack information into an array.

  • If exc_info_as_array is True (Defualt: False), formatter encode exc_info into an array.
  • If stack_info_as_array is True (Defualt: False), formatter encode stack_info into an array.

Checks

All tests are passed (including new test cases).

(python-json-logger) python-json-logger > black src tests
All done! ✨ 🍰 ✨
13 files left unchanged.
(python-json-logger) python-json-logger > pylint --output-format=colorized src

--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)

(python-json-logger) python-json-logger > mypy src tests
Success: no issues found in 13 source files
(python-json-logger) python-json-logger > pytest
=========================================================================== test session starts ===========================================================================
platform darwin -- Python 3.11.11, pytest-8.3.4, pluggy-1.5.0
rootdir: /Users/hakusai/src/python-json-logger
configfile: pyproject.toml
collected 181 items                                                                                                                                                       

tests/test_deprecation.py ......                                                                                                                                    [  3%]
tests/test_formatters.py ..............................................................................................................................x........... [ 79%]
x..x........x....................                                                                                                                                   [ 97%]
tests/test_missing.py ....                                                                                                                                          [100%]

===================================================================== 177 passed, 4 xfailed in 0.22s ======================================================================

Copy link
Owner

@nhairs nhairs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels like we should be overriding formatStack and formatException - thoughts?

Also don't forget to update the documentation.

@1hakusai1
Copy link
Contributor Author

Should I update changelog.md and the version number in pyproject.toml?
I don't know whether to update now or upon release.

@nhairs
Copy link
Owner

nhairs commented Jan 10, 2025

I'll get back to this, got a busy few weeks so don't have time at the moment sorry

@nhairs nhairs force-pushed the feature-stack-trace-as-array branch from 40ccb83 to 7dfc5bb Compare February 1, 2025 04:57
Copy link
Owner

@nhairs nhairs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your patience

  • I have a few nit-pick comments
  • Please do add to the change log, you can just make the version title UNRELEASED and I'll update it and the pyproject.toml when I package it.
  • Please consider updating the documentation

1hakusai1 and others added 8 commits February 2, 2025 22:51
Co-authored-by: Nicholas Hairs <nicholashairs@gmail.com>
Co-authored-by: Nicholas Hairs <nicholashairs@gmail.com>
Co-authored-by: Nicholas Hairs <nicholashairs@gmail.com>
Co-authored-by: Nicholas Hairs <nicholashairs@gmail.com>
@1hakusai1 1hakusai1 requested a review from nhairs February 2, 2025 14:35
Copy link
Owner

@nhairs nhairs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this, nice work.

I'll work on releasing this soon

@nhairs nhairs merged commit db04a0f into nhairs:main Feb 4, 2025
4 checks passed
@nhairs nhairs self-assigned this Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Encode stack traces as an array
2 participants