Avoid some Logger instantiations per request#50184
Avoid some Logger instantiations per request#50184adityamandaleeka merged 1 commit intodotnet:mainfrom
Conversation
`CreateLogger<T>` always creates a new `Logger<T>` instance. `CreateLogger(typeof(T))` delegates to the factory, and thus typically doesn't.
The generic one is statically typed to return
Please share. |
Technically, sure, it could have a thread-safe cache per |
CreateLogger<T>returns anILogger<T>and always allocates a newLogger<T>instance.CreateLogger(typeof(T))returns a non-genericILoggerand delegates to the factory'sCreateLogger, thus typically not allocating a new one.