Repository navigation
Fix inaccurate LogLevel constraint in LoggerMessageAttribute remarks - #130320
Merged
Merged
Conversation
Contributor
|
Tagging subscribers to this area: @dotnet/area-extensions-logging |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the XML documentation remarks on Microsoft.Extensions.Logging.LoggerMessageAttribute to correct the stated requirements around how a log level is provided to the source generator.
Changes:
- Updates the remarks bullet that previously claimed the method must include a
LogLevelparameter. - Documents alternative ways to provide the log level (attribute ctor /
Levelproperty vs. method parameter).
The log level can be set on the attribute (via a constructor or the Level property) instead of a method parameter.
tarekgh
force-pushed
the
fix-loggermessage-loglevel-remarks
branch
from
July 7, 2026 21:38
13a93f3 to
568ea84
Compare
svick
reviewed
Jul 8, 2026
eiriktsarpalis
pushed a commit
that referenced
this pull request
Jul 15, 2026
…130320) The remarks for `LoggerMessageAttribute` incorrectly stated that the decorated method must have a `LogLevel` parameter. The log level can instead be set on the attribute (via a constructor or the `Level` property), and defaults to `LogLevel.None` when unspecified. Updated the remarks accordingly. Fixes #130319 --------- Co-authored-by: Tarek Mahmoud Sayed <[email protected]>
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The remarks for
LoggerMessageAttributeincorrectly stated that the decorated method must have aLogLevelparameter. The log level can instead be set on the attribute (via a constructor or theLevelproperty), and defaults toLogLevel.Nonewhen unspecified. Updated the remarks accordingly.Fixes #130319