Closed
Description
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.