Skip to content

Support nested logging classes in Logging Source Generator #52301

Closed

Description

@eerhardt

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

Activity

  1. ghost added
    untriagedNew issue has not been triaged by the area owner
    on May 5, 2021
  2. removed
    untriagedNew issue has not been triaged by the area owner
    on May 5, 2021
  3. added this to the 6.0.0 milestone on May 5, 2021
  4. self-assigned this
    on Jun 8, 2021
  5. ghost added
    in-prThere is an active PR which will close this issue when it is merged
    on Jun 14, 2021
  6. ghost removed
    in-prThere is an active PR which will close this issue when it is merged
    on Jun 15, 2021
  7. ghost locked as resolved and limited conversation to collaborators on Jul 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions