-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
[LSG] Logging Source Generator fails to compile when out
parameter modifier is present
#64665
Comments
Tagging subscribers to this area: @dotnet/area-extensions-logging Issue DetailsAs part of issue #62644 we fixed compile errors with using But for
|
out
parameter modifier is presentout
parameter modifier is present
Hi @maryamariyan, I'd like to be assigned to this one :) |
The proposed diagnostic descriptor would be: public static DiagnosticDescriptor InvalidLoggingMethodParameterOut { get; } = new DiagnosticDescriptor(
id: "SYSLIB1024",
title: new LocalizableResourceString(nameof(SR.InvalidLoggingMethodParameterOutTitle), SR.ResourceManager, typeof(FxResources.Microsoft.Extensions.Logging.Generators.SR)),
messageFormat: new LocalizableResourceString(nameof(SR.InvalidLoggingMethodParameterOutMessage), SR.ResourceManager, typeof(FxResources.Microsoft.Extensions.Logging.Generators.SR)),
category: "LoggingGenerator",
DiagnosticSeverity.Error,
isEnabledByDefault: true); With the following title:
And the following message format:
|
@allantargino feel free to submit a PR for that and I can help reviewing. Thanks for willing to help with this issue. |
Forgot to mention, we need to do "Take diagnostic message/severity/category to API review" first. I'll try to edit the issue description and then take it to the API review first. Please hold creating the PR till we get the design review approval. |
Thanks @tarekgh. I just updated the proposal in my comment above to have both message title and format (instead of just message format). Would you please update the description? Thanks! |
Did you mean this will be the title? |
Yes, my bad 😄 I just updated it again. |
Looks good as proposed. |
Adds a diagnostic that explains out usage is not supported for LoggerMessageAttribute annotated logging methods fixes dotnet#64665
As part of issue #62644 we fixed compile errors with using
ref
orin
.But for
out
usage, we would need to add a diagnostic that explainsout
usage is not supported forLoggerMessageAttribute
annotated logging methods.Proposal
The proposed diagnostic descriptor would be:
With the following title:
And the following message format:
Code Sample
TODO:
The text was updated successfully, but these errors were encountered: