Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Winston Logger - NodeJs Debug console logs not showing in VSCode

I'm using VSCode debugger and winston logger for NodeJS, but can't see output from application unless I specify external terminal like this:

"version": "0.2.0", "configurations": [     {         "type": "node",         "request": "launch",         "name": "Launch Program",         "program": "${workspaceFolder}/server.js",         "console": "externalTerminal"     } ] 

Is there way to see that output in output window, like when i start code using CodeRunner plugin?

like image 797
Josip Avatar asked Dec 29 '17 19:12

Josip


People also ask

How do I debug console in VS code?

To bring up the Run and Debug view, select the Run and Debug icon in the Activity Bar on the side of VS Code. You can also use the keyboard shortcut Ctrl+Shift+D. The Run and Debug view displays all information related to running and debugging and has a top bar with debugging commands and configuration settings.

What is JavaScript debug terminal in Vscode?

JavaScript Debug Terminal# In a similar way to auto attach, the JavaScript Debug Terminal will automatically debug any Node. js process you run in it. You can create a Debug Terminal by running the Debug: Create JavaScript Debug Terminal command from the Command Palette ( kbs(workbench. action.


1 Answers

When using a logger that outputs to

process.stdout.write

you can use

"outputCapture": "std" in the launch config to also capture that.

like image 122
Cody G Avatar answered Oct 05 '22 15:10

Cody G