-
Notifications
You must be signed in to change notification settings - Fork 5.1k
[Group 3] Enable nullable annotations for Microsoft.Extensions.Logging
#65262
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
Conversation
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
Tagging subscribers to this area: @dotnet/area-extensions-logging Issue DetailsRelated to #43605 Questions:
|
Have no idea, why CI fails. |
looking |
I noticed that running
auto generates the small diff in 23dc4b5 . Would you like to push this commit onto this PR to see if retriggering CI this way would fix the CI failures? |
src/libraries/Microsoft.Extensions.Logging/src/LoggerFactory.cs
Outdated
Show resolved
Hide resolved
src/libraries/Microsoft.Extensions.Logging/src/LoggerFactoryScopeProvider.cs
Show resolved
Hide resolved
src/libraries/Microsoft.Extensions.Logging/src/LoggerInformation.cs
Outdated
Show resolved
Hide resolved
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.
Aside the question in https://github.com/dotnet/runtime/pull/65262/files#r817973746 the rest looks fine to me.
@maryamariyan Hi, I'm in Ukraine (currently relatively safe in Lviv), so cannot be as active. I'll try to address the comments when I can, but if I don't respond for tool long or disappear altogether, feel free to commit to my branches. |
You need to invoke Pack in order for package validation to run, and for it to emit the baseline file. Try doing: |
src/libraries/Microsoft.Extensions.Logging/src/CompatibilitySuppressions.xml
Outdated
Show resolved
Hide resolved
src/libraries/Microsoft.Extensions.Logging/src/CompatibilitySuppressions.xml
Outdated
Show resolved
Hide resolved
Co-authored-by: Jose Perez Rodriguez <joperezr@microsoft.com>
src/libraries/Microsoft.Extensions.Logging/src/LoggerInformation.cs
Outdated
Show resolved
Hide resolved
src/libraries/Microsoft.Extensions.Logging/src/LoggerFactoryScopeProvider.cs
Outdated
Show resolved
Hide resolved
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.
LGTM aside from the ScopeLogger portion in #65262 (comment)
This reverts commit 369ad43.
src/libraries/Microsoft.Extensions.Logging/src/LoggerInformation.cs
Outdated
Show resolved
Hide resolved
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.
This looks great. Thanks again for all the work here, @maxkoshevoi!
Stay safe my friend. |
…ng` (dotnet#65262) * First pass * Second pass * Pass three * Missed few things * ref * Update ProviderAliasUtilities.cs * Update ActivityTrackingOptions.cs * Update Microsoft.Extensions.Logging.cs * GetRequiredService * Update Logger.Scope * Create CompatibilitySuppressions.xml * Add comment to CompatibilitySuppressions.xml Co-authored-by: Jose Perez Rodriguez <joperezr@microsoft.com> * Delete CompatibilitySuppressions.xml * AsyncLocal<Scope?> _currentScope * Add assert Co-authored-by: Jose Perez Rodriguez <joperezr@microsoft.com>
Related to #43605
Questions:
GetRequiredService
here, sinceDisposingLoggerFactory
doesn't accept null loggerFactoryruntime/src/libraries/Microsoft.Extensions.Logging/src/LoggerFactory.cs
Lines 97 to 98 in 348e06c
Logger
can be null here, I see no checks that say it couldn'truntime/src/libraries/Microsoft.Extensions.Logging/src/LoggerInformation.cs
Line 63 in 348e06c
runtime/src/libraries/Microsoft.Extensions.Logging/src/LoggerFactory.cs
Line 236 in 348e06c
Alias
can be null. Marked it as non-nullable for now: https://github.com/dotnet/runtime/blob/main/src/libraries/Microsoft.Extensions.Logging/src/ProviderAliasAttribute.cs