Debug level information fails to output in VS Code

纵然是瞬间 提交于 2021-02-20 04:01:25

问题


In the ConfigureServices method I'm using:

var loggerFactory = new LoggerFactory();   
loggerFactory.AddDebug();

However, use of LogDebug() fails to output to the debug console.


回答1:


Rather than rely on AddDebug()... specify the minimum log level with AddConsole() and the debug level information outputs to the console as expected:

loggerFactory.AddConsole(LogLevel.Debug);

This works because the methods AddConsole(), AddDebug() etc. only specify where to log information. The issue is discussed in more depth here.



来源:https://stackoverflow.com/questions/48938036/debug-level-information-fails-to-output-in-vs-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!