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

ResponseLogger constructor overload receiving the response #4051

Merged
merged 1 commit into from Dec 30, 2020
Merged

ResponseLogger constructor overload receiving the response #4051

merged 1 commit into from Dec 30, 2020

Conversation

Lasering
Copy link
Contributor

@Lasering Lasering commented Dec 22, 2020

Refactor Logger implementation.
Add customized loggers.
Add colored loggers.
Closes #4019

Refactor Logger implementation.
Add customized loggers.
Add colored loggers.
@Lasering
Copy link
Contributor Author

In package org.http4s.client.middleware:

  • Logger#logMessage is just an alias for org.http4s.internal.Logger#logMessage
  • RequestLogger#apply invokes Logger#logMessage
  • but RequestLogger#logBodyText invokes org.http4s.internal.Logger#logMessageWithBodyText.

Seems to me Logger#logMessage is only causing entropy.

@Lasering Lasering changed the title Closes #4019. ResponseLogger constructor overload receiving the response Dec 22, 2020
Copy link
Member

@rossabaker rossabaker left a comment

Choose a reason for hiding this comment

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

I wonder if we could do something a bit more builder-like and get rid of some of these repeated parameters across the various constructors (e.g., redactHeadersWhen). The overall API feels a lot larger to me than it ought to be.

That said, I think the new functionality is neat, and the refactoring smart. 👍 to this.

@rossabaker rossabaker merged commit 0368053 into http4s:main Dec 30, 2020
@rossabaker
Copy link
Member

I just noticed this went to main while doing release notes. I think it was binary compatible, and could be backported if we're interested.

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.

ResponseLogger constructor overload receiving the response
2 participants