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

Support nested logging classes in Logging Source Generator #52301

Closed
eerhardt opened this issue May 5, 2021 · 1 comment · Fixed by #54180
Closed

Support nested logging classes in Logging Source Generator #52301

eerhardt opened this issue May 5, 2021 · 1 comment · Fixed by #54180
Assignees
Milestone

Comments

@eerhardt
Copy link
Member

eerhardt commented May 5, 2021

A common logging pattern is to put all the logging related methods in a nested class of the service that needs to log. However, the Logging Source Generator doesn't support this. When I try to do it, I get an error saying:

Severity	Code	Description	Project	File	Line	Suppression State
Error	SYSLIB1004	Logging class cannot be in nested types	Microsoft.Extensions.Diagnostics.HealthChecks	C:\git\aspnetcore\src\HealthChecks\HealthChecks\src\DefaultHealthCheckService.cs	201	

We should support this common coding pattern in the Logging Source Generator.

See discussion at dotnet/aspnetcore#32414 (comment)

cc @maryamariyan @davidfowl @shirhatti

@ghost
Copy link

ghost commented May 5, 2021

Tagging subscribers to this area: @maryamariyan
See info in area-owners.md if you want to be subscribed.

Issue Details

A common logging pattern is to put all the logging related methods in a nested class of the service that needs to log. However, the Logging Source Generator doesn't support this. When I try to do it, I get an error saying:

Severity	Code	Description	Project	File	Line	Suppression State
Error	SYSLIB1004	Logging class cannot be in nested types	Microsoft.Extensions.Diagnostics.HealthChecks	C:\git\aspnetcore\src\HealthChecks\HealthChecks\src\DefaultHealthCheckService.cs	201	

We should support this common coding pattern in the Logging Source Generator.

See discussion at dotnet/aspnetcore#32414 (comment)

cc @maryamariyan @davidfowl @shirhatti

Author: eerhardt
Assignees: -
Labels:

area-Extensions-Logging

Milestone: -

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label May 5, 2021
@maryamariyan maryamariyan removed the untriaged New issue has not been triaged by the area owner label May 5, 2021
@maryamariyan maryamariyan added this to the 6.0.0 milestone May 5, 2021
@maryamariyan maryamariyan self-assigned this Jun 8, 2021
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Jun 14, 2021
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Jun 15, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Jul 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants