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

feat: support response body/headers logging on errors #20

Merged
merged 1 commit into from
Oct 16, 2024

Conversation

msutkowski
Copy link
Member

@msutkowski msutkowski commented Oct 15, 2024

It'd be really nice if on error cases if we have the option of logging out the response body to making debugging a bit easier. I've set this to default to true as it makes sense to me, and should really only be turned off if you like pain.

Copy link

@btkostner btkostner left a comment

Choose a reason for hiding this comment

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

Seems sane

capture_io(:standard_error, fn ->
ErrorPlug.call(conn, [])
Logger.flush()
Process.sleep(10)
Copy link

Choose a reason for hiding this comment

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

Does the test fail without Process.sleep(10)?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yea - looks like we can actually remove all of them. I can't see a reason as to why we have any of these in here outside of what was in the logger case from ~8 years ago? 🤔

@msutkowski msutkowski merged commit 06095c9 into main Oct 16, 2024
9 checks passed
@msutkowski msutkowski deleted the ms/response_logging branch October 16, 2024 17: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