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

2

22

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?

Guria answered 12/2, 2019 at 17:10 Comment(2)
it might be outputting log IN-APP: check your developer tools window inside the electron appEvangelize
No, I put the logs in the main process, not in render process. So it has to be displayed in the debug-console on the code.Guria
M
44

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

example

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

Mourant answered 5/2, 2020 at 23:30 Comment(2)
it stopes to the breakpoint and it doesnt show the printed output on the console. However if I run without debug it prints the result normaly...Kip
What is the significance of the version field, and is it necessary if you don't care to specify one?Rhododendron
H
0

Maybe there may be some text left in the filter of the terminal window. If you delete it it will be fixed.

Halation answered 9/4 at 7:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.