-
Notifications
You must be signed in to change notification settings - Fork 757
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
Conversation
429c3b3
to
001a5d5
Compare
001a5d5
to
23d8c13
Compare
@@ -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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this 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
There was a problem hiding this 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.
null
Microsoft Reviewers: Open in CodeFlow