Open yaakov-h opened 1 year ago
Microsoft.Extensions.Logging feels like it might be a little too far removed from the "standard framework" for us to manage here.
It's part of the standard framework in ASP.NET Core applications, and part of dotnet/runtime, so it depends how you count.
When using Microsoft.Extensions.Logging and Dependency Injection, a type
T
should typically be injected withILogger<T>
.For example:
This automatically configures the Category of the logs produced by this logger:
In an inheritance tree, I've seen a lot of people lazily satisfy the compiler and intellisense by passing in
ILogger<base>
instead, e.g.:We should detect this with a diagnostic and code fix.