最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin1浏览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));"
发布评论

评论列表(0)

  1. 暂无评论