-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
minor #54668 [HttpClient] Implemented LoggerAwareInterface in HttpCli…
…entInterface decorators (yann-eugone) This PR was squashed before being merged into the 7.1 branch. Discussion ---------- [HttpClient] Implemented LoggerAwareInterface in HttpClientInterface decorators Implement `Psr\Log\LoggerAwareInterface` in `Symfony\Component\HttpClient\UriTemplateHttpClient`. | Q | A | ------------- | --- | Branch? | 7.1 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | | License | MIT I was on a journey to enhance our logs on a project that highly depend on `HttpClient`. I started to separate logs per feature, and I wanted to include `HttpClient` logs to the logger of the currently running the feature. I figured out that most implementations of `HttpClientInterface` are implementing `LoggerAwareInterface`, so I decided to just call `$client->setLogger(...)` on my side. And **nothing changed**. Nothing changed because my logger is decorated by the `UriTemplateHttpClient` that is not implementing `LoggerAwareInterface`. Althought `UriTemplateHttpClient` has no need of a logger, as a decorator it should be able to act like it, so the underlying client can be reached. This is what is done for instance in `Symfony\Component\HttpClient\TraceableHttpClient`. Commits ------- c2a7b73 [HttpClient] Implemented LoggerAwareInterface in HttpClientInterface decorators
- Loading branch information
Showing
5 changed files
with
50 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters