Obama nation
Obama nation

Reputation: 411

Showing all output in the console VS code

I am using console.log in my javascript program in VS code to output to the console a lot of values. When I print a few values to the console using console.log, I am able to see every value in the console window as normal. But when there are a lot of them, the values seem to get cut off. Is there some sort of option in VS code that allows me to print everything to the console without it being cut off at some limit?

Upvotes: 30

Views: 68234

Answers (5)

Aexki
Aexki

Reputation: 436

Go to File > Preferences > Settings, search for "Scrollback," and increase the value to get the desired number of output lines.

This worked for me.

Upvotes: 41

inside vs code settings search for scrollback option and change the second option to number of lines you want vscode screenshot

Upvotes: 2

narender kumar
narender kumar

Reputation: 1

if the string is large then use log("value".tosting()). to check the answer

Upvotes: 0

Arin Yazilim
Arin Yazilim

Reputation: 1117

For MAC users:

Code => Preferences => Settings => (Search for "scrollback") => Write higher number for "Terminal › Integrated: Scrollback".

Upvotes: 7

Govi-Boy
Govi-Boy

Reputation: 99

In order to achieve that you need to make a change in your launch.json configuration of xdebug in VS Code.

The piece of configuration you will need to add to your configuration of launch.json is "xdebugSettings": { "max_data": -1 }

A simple configuration should look like that

{ "version": "0.2.0", "configurations": [ { "name": "Listen for XDebug", "type": "php", "request": "launch", "port": 9000, "serverSourceRoot": "/var/www/myapp/", "localSourceRoot": "${workspaceRoot}/", "xdebugSettings": { "max_data": -1 } }] }

xdebugSettings.max_data Controls the maximum string length that is shown when variables are displayed. To disable any limitation, use -1 as value.

Good luck.

Upvotes: 0

Related Questions