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

[HttpClient] Add LoggerAwareInterface to ScopingHttpClient and TraceableHttpClient #35273

Merged
merged 1 commit into from Jan 10, 2020

Conversation

@pierredup
Copy link
Contributor

pierredup commented Jan 9, 2020

Q A
Branch? master
Bug fix? no
New feature? yes
Deprecations? no
Tickets N/A
License MIT
Doc PR N/A

This allows changing the logger when using ScopingHttpClient (and TraceableHttpClient during dev)

@pierredup pierredup force-pushed the pierredup:http-client-logger branch from f66afc4 to 7348fb2 Jan 9, 2020
@pierredup pierredup force-pushed the pierredup:http-client-logger branch from 7348fb2 to 1137bdc Jan 9, 2020
@nicolas-grekas nicolas-grekas added this to the next milestone Jan 9, 2020
@nicolas-grekas

This comment has been minimized.

Copy link
Member

nicolas-grekas commented Jan 9, 2020

But one should be able to configure the decorated client before decorating it. I think not having this method encourages better instantiation steps. I get this can be helpful, but maybe here we'd prefer favoring better design?

@pierredup

This comment has been minimized.

Copy link
Contributor Author

pierredup commented Jan 9, 2020

But one should be able to configure the decorated client before decorating it

This doesn't work when injecting a scoped client from the framework configuration, as you are then stuck with the default logger and can't change it at runtime (E.G injecting a ConsoleLogger when running in CLI)

@fabpot
fabpot approved these changes Jan 10, 2020
@fabpot

This comment has been minimized.

Copy link
Member

fabpot commented Jan 10, 2020

Thank you @pierredup.

fabpot added a commit that referenced this pull request Jan 10, 2020
…ient and TraceableHttpClient (pierredup)

This PR was merged into the 5.1-dev branch.

Discussion
----------

[HttpClient] Add LoggerAwareInterface to ScopingHttpClient and TraceableHttpClient

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | N/A
| License       | MIT
| Doc PR        | N/A

This allows changing the logger when using `ScopingHttpClient` (and `TraceableHttpClient` during dev)

Commits
-------

1137bdc Add LoggerAwareInterface to ScopingHttpClient and TraceableHttpClient
@fabpot fabpot merged commit 1137bdc into symfony:master Jan 10, 2020
2 of 3 checks passed
2 of 3 checks passed
continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
fabbot.io Your code looks good.
Details
@pierredup pierredup deleted the pierredup:http-client-logger branch Jan 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.