Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@javanlacerda
Copy link
Contributor

It truncates the extras value for logging, as it can be used to log full exception stacktracing, blowing our log size threshold.

@javanlacerda javanlacerda force-pushed the javan.truncate_extras_value branch 3 times, most recently from cb2c035 to 6c187b5 Compare April 8, 2025 20:07
# This extras field is needed because the call
# getattr(record, 'extras', {}) returns None and not the
# default for the case of running against a mock
extras={"test": "1"},
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe a better workaround would be extras={}?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It works too.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Just because the test being called test_no_extras and having extras is kind of misleading.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, to avoid misunderstanding, I said your suggestion works too, and then I applied it. Thanks for it!

Signed-off-by: Javan Lacerda <[email protected]>
Signed-off-by: Javan Lacerda <[email protected]>
@javanlacerda javanlacerda force-pushed the javan.truncate_extras_value branch from 340bcec to 3ce5291 Compare April 9, 2025 12:46
@javanlacerda javanlacerda merged commit 1e1c2b6 into master Apr 9, 2025
7 checks passed
@javanlacerda javanlacerda deleted the javan.truncate_extras_value branch April 9, 2025 13:01
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.

3 participants