VS Code .NET Core项目显示详细的调试控制台消息 [英] VS Code .NET Core project shows verbose debug console messages
问题描述
我是VS Code的新手。但是,我在一个项目中注意到的一件事确实困扰着我。每当我使用内置调试器在VS Code中运行该项目时,它就会向我显示一条消息,如下所示:
I am new to VS Code. However, one thing thing that I noticed with one of the project that I have is really bugging me. Whenever, I run the project in VS Code using its in-built debugger, it shows me a message which looks like following:
Loaded / usr /local/share/dotnet/shared/Microsoft.NETCore.App/2.0.0/System.Private.CoreLib.dll。跳过的加载符号。模块已优化,调试器选项 Just My Code已启用
,它显示了我引用的每个DLL的消息。这会在我的调试控制台中导致大量不必要的日志。我有两个问题:
And it shows that message for each DLL that I have referenced. This causes huge amount of unwarranted logs in my Debug Console. I have two questions:
- 为什么显示此信息?
- 是否可以获取
推荐答案
适用于dotnet core 2.2,未在其他任何地方进行验证
我刚刚找到了一种使用 logging
选项消除大多数噪音的方法。不幸的是,我仍然看到一些程序输出,例如线程信息,因为我们当前有日志记录到控制台。我还没有完全按照自己喜欢的方式进行设置,但现在效果更好。
I just found a way to get rid of most of this noise using the logging
options. Unfortunately, I still see some program output like thread info because we currently have logging going to the console. I haven't completely set it up the way I like, but this works better for now.
在中。/.vscode/launch.json
,将 logging
选项添加到您的配置中:
In ./.vscode/launch.json
, add the logging
options to your config:
"configurations": [
{
"name": "Your config name",
"type": "coreclr",
"request": "launch",
"logging": {
"engineLogging": false,
"moduleLoad": false,
"exceptions": false,
"browserStdOut": false
},
// ... the rest of your existing config. surrounding code shown for placement purposes.
您可能仍然希望将异常输出到控制台,但是到目前为止,我发现即使处理了异常正在记录。我想忽略这些,因此在这里将例外
设置为 false
。
You may still want exceptions output to the console, but so far I've found that even handled exceptions are being logged. I want to ignore those, so I've set exceptions
to false
here.
这篇关于VS Code .NET Core项目显示详细的调试控制台消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!