我正在尝试登录控制台,但是当我这样做时:
//setup our DI
var serviceProvider = new ServiceCollection()
.AddSingleton(new LoggerFactory()
.AddConsole(LogLevel.Debug))
.BuildServiceProvider();
var logger = serviceProvider.GetService<ILoggerFactory>()
.CreateLogger<Program>();
var enabled = logger.IsEnabled(LogLevel.Debug); // This is true
logger.LogDebug("Starting application"); // does not show up in console
我的控制台中什么都没有显示!我想念什么?!?