调试级别信息无法在VS Code中输出 [英] Debug level information fails to output in VS Code

查看:104
本文介绍了调试级别信息无法在VS Code中输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ConfigureServices 方法中,我正在使用:

In the ConfigureServices method I'm using:

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

但是,使用 LogDebug()不能输出到调试控制台.

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

推荐答案

而不是依赖AddDebug()...使用AddConsole()指定最小日志级别,并将调试级别信息输出到控制台按预期:

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);

之所以可行,是因为方法AddConsole(),AddDebug()等仅指定 where 来记录信息.在此处中对此问题进行了更深入的讨论.

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

这篇关于调试级别信息无法在VS Code中输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆