Search code examples
javascriptdebuggingvisual-studio-codeconsoleelectron

console.log is not printing to Debug Console in Visual Studio Code


I have created launch.json file exactly as this for debugging my Electron Application on VS Code. But the console.log() not printing anything to the debug console.

If I add "console": "integratedTerminal" to launch.json the log displays on the built in terminal. I want the log to be displayed on debug console. How can I fix it?


Solution

  • In the launch.json configuration you are using, add "outputCapture": "std"

    example

    {
      "version": "0.2.0",
      "configurations": [
        {
          "type": "node",
          "request": "launch",
          "outputCapture": "std",
          ...
      }
      ]
    }