Can someone explain to me why this doesn't just work? This feels astonishing to me. If this is not a viable usage, I would say that this is a design smell. I should either be not permitted to do this by the API's design, or I would expect a useful error.
public static void Main(string[] args)
{
var l = new ConsoleLogger("test", (s, ll) => true, true);
l.WriteMessage(LogLevel.Critical, "test", 0, "hello world", null);
}
This implementation outputs literally nothing. Why? I don't feel like I should have to use the DependencyInjection and service location mechanisms.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…