logging - Visual Studio Code 不显示控制台日志

标签 logging console visual-studio-code

例如,在此方法中,我使用 console.log() 登录到控制台以进行调试

_onSearchTextChanged = (event) => {
    console.log('_onSearchTextChanged');
    ...
};

但是 Visual Studio Code 在控制台中没有显示任何内容

enter image description here

最佳答案

如果您在 Visual Studio 代码中使用 Debug模式,则可以添加选项:

{
 "outputCapture": "std"
}
这会将您的日志重定向到调试控制台内。
编辑:正如 Luigi04 在评论部分提到的,这个设置需要放在 launch.json

关于logging - Visual Studio Code 不显示控制台日志,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45667351/

相关文章:

c# - 'Press Any key to continue.... '的解释

android - VS Code 可以在 Android 上运行吗?

python - python 3 curses 包装器的类型提示

visual-studio-code - VSCode 中的 JSDoc 注释折叠

ios - 提交到 AppStore : Found an unexpected Mach-O header code: 0x72613c21

c++ - Eclipse CDT 控制台输出未显示在带有路径的调试中,也未显示在没有路径的运行中

azure - 如何在Azure Portal中查看实际的事件网格消息?

Java 控制台程序

ios - 临时应用程序构建中的错误记录和检索?

java - 我怎样才能理顺我的 Tomcat 日志记录?