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

Update HttpClient logging APIs per Noah's comments #4469

Merged
merged 1 commit into from
Sep 27, 2023

Conversation

geeknoid
Copy link
Member

@geeknoid geeknoid commented Sep 26, 2023

null

Microsoft Reviewers: Open in CodeFlow

@ghost ghost assigned geeknoid Sep 26, 2023
@geeknoid geeknoid marked this pull request as ready for review September 26, 2023 03:37
@@ -28,7 +28,7 @@ public static class HttpClientLoggingServiceCollectionExtensions
/// All other loggers are removed - including the default one, registered via <see cref="HttpClientBuilderExtensions.AddDefaultLogger(IHttpClientBuilder)"/>.
/// </remarks>
/// <exception cref="ArgumentNullException">Argument <paramref name="services"/> is <see langword="null"/>.</exception>
public static IServiceCollection AddDefaultHttpClientLogging(this IServiceCollection services)
public static IServiceCollection AddExtendedHttpClientLogging(this IServiceCollection services)
Copy link
Contributor

Choose a reason for hiding this comment

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

So, now both names are the same?
IServiceCollection.AddExtendedHttpClientLogging and IHttpClientBuilder.AddExtendedHttpClientLogging
Wouldn't it confuse users?

Copy link
Member

Choose a reason for hiding this comment

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

IMO as long as serviceCollection.AddExtendedHttpClientLogging() has the same behavior as services.ConfigureHttpClientDefaults(httpBuilder => httpBuilder.AddExtendedHttpClientLogging()) then I wouldn't expect significant confusion. Worst case if a customer was aware of both and confused by it there is still no wrong answer, whichever one they try will work.

@davidfowl I think has stronger opinions that we should avoid offering IServiceCollection extension methods when a sub-builder extension method also exists. Personally I'm neutral about this pattern, but assuming I didn't misunderstand his position, he'd probably want us not to include the IServiceCollection variant.

Copy link
Contributor

@xakep139 xakep139 left a comment

Choose a reason for hiding this comment

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

Left only one comment, otherwise looks good

Copy link
Member

@noahfalk noahfalk left a comment

Choose a reason for hiding this comment

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

I'm happy. @davidfowl take a look since it seemed like you wanted to avoid extension methods simultaneously on IServiceCollection and sub-builders.

@geeknoid geeknoid merged commit ce47e47 into release/8.0 Sep 27, 2023
6 checks passed
@geeknoid geeknoid deleted the geeknoid/renames branch September 27, 2023 13:26
@ghost ghost locked as resolved and limited conversation to collaborators Oct 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants