Skip to content

improv(logger): Format the stack trace as an array of strings in dev mode #3852

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ConnorKirk
Copy link
Contributor

Summary

When POWERTOOLS_DEV is enabled, the stack trace will be split on newline characters to create an array. This improves readability compared to a single long string

Changes

  • Update the formatError method of the default Powertools formatter. When POWERTOOLS_DEV is enabled, the stack property will be split into an array
  • Add a test for this new behaviour
  • Update some existing tests affected by this behaviour change

Please provide a summary of what's being changed

Please add the issue number below, if no issue is present the PR might get blocked and not be reviewed

Issue number: #1362


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@boring-cyborg boring-cyborg bot added logger This item relates to the Logger Utility tests PRs that add or change tests labels Apr 23, 2025
@pull-request-size pull-request-size bot added the size/M PR between 30-99 LOC label Apr 23, 2025
@dreamorosi dreamorosi changed the title fix(logger): Format the stack trace as an array of strings in dev mode improv(logger): Format the stack trace as an array of strings in dev mode Apr 23, 2025
@github-actions github-actions bot added bug Something isn't working enhancement PRs that introduce minor changes, usually to existing features labels Apr 23, 2025
When POWERTOOLS_DEV is enabled, the stack trace will be split on newline characters to create an array. This improves readability compared to a single long string
@ConnorKirk ConnorKirk force-pushed the 1362-format-stack-trace-in-dev-mode branch from c17e26d to dc238e1 Compare April 23, 2025 16:36
@dreamorosi dreamorosi added do-not-merge This item should not be merged and removed bug Something isn't working labels Apr 23, 2025
@dreamorosi dreamorosi self-requested a review April 23, 2025 16:55
Copy link
Contributor

@dreamorosi dreamorosi 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 the PR - I'll merge it after tomorrow's release so it's included in the following release.

Other than that's it's approved so from your side you can consider it done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge This item should not be merged enhancement PRs that introduce minor changes, usually to existing features logger This item relates to the Logger Utility size/M PR between 30-99 LOC tests PRs that add or change tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants