Node.JS Winston 日志记录,Visual Studio 调试控制台不打印

标签 node.js

在 winston logging 期间在 visual studio code 的终端上作为“node app”运行时,输出控制台日志。 但是visual studio的debug console选项卡不打印console log。 为什么?

enter image description here enter image description here

最佳答案

下面是我的 launch.json 关键是 "outputCapture": "std",

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "launch",
            "name": "Launch Program",
            "outputCapture": "std", //key is this line
            "program": "${workspaceFolder}/bin/www"
        }
    ]
}

关于Node.JS Winston 日志记录,Visual Studio 调试控制台不打印,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45539958/

相关文章:

node.js - Mongoose - 如何防止 mongoose 在模型实例化时创建 _id

javascript - 无法运行 node.js 服务器以使用 express 和 multer 在 Node 中上传文件

http - 将 node.js 中的 UDP 套接字从应用程序传输到 HTTP

mysql - Sequelize - 嵌套模型中的 order by 不适用于 mysql

node.js - nodejs 中的永远是什么?

html - 如何在 node.js EJS View 中转义 HTML?

node.js - 如何从docker安装git和gatsby

node.js - mongoosastic findOneAndUpdate 不在elasticsearch 中建立索引

node.js - value.map 不是 Sequelize findAll with 或 Param 中的函数

javascript - Express 路由器无法按预期使用子目录