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

PB-931 Change behavior of exc_text and stack_info - #major #63

Merged
merged 3 commits into from
Jan 17, 2025

Conversation

schtibe
Copy link
Contributor

@schtibe schtibe commented Jan 9, 2025

Changing the exc_text and stack_info behavior.

Instead of attaching these fields directly to the message by default we pass it to the formatter. This allows fore more control through the configuration, for instance through specifying it like this:

fmt:
  trace: stack_info
  error:
    stack_trace: exc_text

@github-actions github-actions bot changed the title WIP Fix exc_text WIP Fix exc_text - #minor Jan 9, 2025
@schtibe schtibe force-pushed the feat-pb-931-python-exception-logging branch 3 times, most recently from 8553ff5 to f6cd651 Compare January 10, 2025 10:36
@schtibe schtibe changed the title WIP Fix exc_text - #minor PB-931 Fix exc_text mapping- #minor Jan 10, 2025
@github-actions github-actions bot changed the title PB-931 Fix exc_text mapping- #minor PB-931 Fix exc_text mapping - #minor Jan 10, 2025
Copy link
Contributor

@ltshb ltshb left a comment

Choose a reason for hiding this comment

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

I don't fully understand what was the issue, because this repository is public and that this library is also public in pypi, we should document this change to be more understandable. Does it affect the use of the library with other framework like Flask ? Having some unittest that test the issue would be also very good.

logging_utilities/formatters/json_formatter.py Outdated Show resolved Hide resolved
@schtibe schtibe force-pushed the feat-pb-931-python-exception-logging branch 5 times, most recently from 46fd92b to 57ce5b6 Compare January 13, 2025 15:10
@schtibe schtibe changed the title PB-931 Fix exc_text mapping - #minor PB-931 Change behavior of exc_text and stack_info - #major Jan 13, 2025
@github-actions github-actions bot changed the title PB-931 Change behavior of exc_text and stack_info - #major PB-931 Fix exc_text mapping - #minor Jan 13, 2025
@github-actions github-actions bot changed the title PB-931 Fix exc_text mapping - #minor PB-931 Change behavior of exc_text and stack_info - #major Jan 13, 2025
@schtibe schtibe force-pushed the feat-pb-931-python-exception-logging branch from 57ce5b6 to e3da9ed Compare January 13, 2025 17:23
@schtibe schtibe force-pushed the feat-pb-931-python-exception-logging branch 4 times, most recently from f4584be to 697ea5a Compare January 16, 2025 12:41
@schtibe schtibe requested review from boecklic and ltshb January 16, 2025 12:42
Copy link
Contributor

@ltshb ltshb left a comment

Choose a reason for hiding this comment

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

Very just a few minor comments on the docu, and I would add 2 unittest case making sure that they are not added by default and that you can add them if required.

README.md Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@schtibe schtibe force-pushed the feat-pb-931-python-exception-logging branch from 697ea5a to 76f2ec1 Compare January 17, 2025 08:06
@schtibe schtibe force-pushed the feat-pb-931-python-exception-logging branch 2 times, most recently from 9a2dce9 to edd3814 Compare January 17, 2025 08:26
Adding the exc_text field to the record before formatting a message.
This allows for formatting the message through the django logging
facility
Removing the addition of exc_text to the message directly. Instead adding
it to the record, so that it can be formatted through the django logging
facility
Add the stack info to the record instead of the message directly in JSON
formatter. This way it can be configured through the Django logging
facility
Document the changes made with regards to logging the traceback.
@schtibe schtibe force-pushed the feat-pb-931-python-exception-logging branch from edd3814 to 67e0651 Compare January 17, 2025 08:35
@schtibe schtibe merged commit 6143af1 into master Jan 17, 2025
3 checks passed
@schtibe schtibe deleted the feat-pb-931-python-exception-logging branch January 17, 2025 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants