Noncompliant Code Examples:
class A
{
private static readonly ILogger Logger = Logger.ForContext<B>();
}
class B {}
class A
{
ILogger<B> _log;
public A(ILogger<B> log)
{
_log = log;
}
}
class B { }
Compliant Solution:
class A
{
private static readonly ILogger Logger = Logger.ForContext<A>();
}
class B {}
class A
{
ILogger<A> _log;
public A(ILogger<A> log)
{
_log = log;
}
}
class B {}