Skip to content

Static logging delegates nested inside generic types #31340

Closed
@JamesNK

Description

@JamesNK

Static logging delegates will allocate a new copy for each generic type.

See #31333 (comment)

Should audit for all usages of static logging delegates to see if there are other places they are nested in generic types.

Before:

// RequestContext.Log.cs
internal sealed partial class RequestContext<TContext>
{
    private static class Log { }
}

After:

// RequestContext.Log.cs
internal static class RequestContext
{
    private static class Log { }
}

Edit: That won't work because Log will be private. How about internal static class RequestContextLog with no nested Log type.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionshelp wantedUp for grabs. We would accept a PR to help resolve this issuetask

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions