javascript - configure Turbo Console Log to automatically wrap logged messages with JSON.stringify() - Stack Overflow

admin2025-04-20  0

How can I configure Turbo Console Log to automatically wrap logged messages with JSON.stringify(), such as to achieve the following output format?

Default Output (Example):

console.log("messages:", messages)

Desired Output:

console.log("messages:", JSON.stringify(messages, null, 2));

How can I configure Turbo Console Log to automatically wrap logged messages with JSON.stringify(), such as to achieve the following output format?

Default Output (Example):

console.log("messages:", messages)

Desired Output:

console.log("messages:", JSON.stringify(messages, null, 2));
Share Improve this question edited Mar 3 at 20:11 Imad asked Mar 3 at 2:08 ImadImad 113 bronze badges 1
  • have you tried to modify settings.json ? – Stan Commented Mar 3 at 4:46
Add a comment  | 

1 Answer 1

Reset to default 0

you can try and add the following to your settings.json:

"turboConsoleLog.logMessage": "console.log(\"${variable}:\", JSON.stringify(${variable}, null, 2));"
转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1745112404a285658.html

最新回复(0)