Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>js console.logNew to Visual Studio Code? Get it now.

js console.log

Jkssns

|
441 installs
| (1) | Free
快速极致的js log
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

JS-CONSOLE (English description translated from Baidu)

功能为快速`console.log();`,节省频繁或打错log的时间。
The function is fast `console.log()`, which saves the time of wrong or frequent logging.


功能 Features


快捷键(Ctrl+1)

功能如gif所示,选中变量按Ctrl+1,快速打一个`console.log();`
The function is shown in gif. Select a variable and press Ctrl+1 to quickly input a `console.log();`

Github上图片地址:https://raw.githubusercontent.com/Jkssns/picture-bed/main/js-log.gif

快捷键(Ctrl+F1)

问题:我们在控制台查看一个对象时,常因为用了框架,对象的属性被代理。在控制台中输出时,输出的是一个引用,对象的属性值都是...,需要点开才能真正输出这个值。还有Vue3,用了Proxy做代理后,每次都需要点击对象,点击target才能查看对应的值。

解决方法:可以在log这个对象的时候,对这个对象进行浅拷贝,切断引用和代理,这样控制台一眼就能看出对象的所有值。

此快捷键功能和Ctrl+1相同,但输出的是`console.log(JSON.parse(JSON.string(variable)));`

Problem: When we view an object on the console, its properties are often proxied because of the use of the framework. When outputting in the console, the output is a reference, and the object's attribute values are all... You need to click Open to actually output this value. There is also Vue3. After Proxy is used, you need to click the object each time and click target to view the corresponding value.

Solution: You can make a shallow copy of the log object, cut off the reference and proxy, and the console can see all the values of the object at a glance.

This shortcut function is the same as Ctrl+1, but the output is `console.log(JSON.parse(JSON.string(variable)));`
Github上图片地址:https://raw.githubusercontent.com/Jkssns/picture-bed/main/copylog.png


快捷键(Ctrl+2)

注释页面所有console
All consoles of note page Github上图片地址:https://raw.githubusercontent.com/Jkssns/picture-bed/main/annotate_action.png


快捷键(Ctrl+F2)

删除页面所有console
Delete all consoles on the page Github上图片地址:https://raw.githubusercontent.com/Jkssns/picture-bed/main/del_action.png


快捷键(Ctrl+3)

随机提示一条激励语,助力你一天的工作效率!
Randomly prompt a motivational message to help you work efficiently in the day!



插件/扩展设置 Extension Settings

| Zh | En | 默认 Default | | ---- | ---- | ---- | | 更改变量引导符 | Change the variable guidance | ::: | | 更改单引号双引号 | Change the single quotation number dual quotation | ' | | 结尾要不要分号 | Semicolon at the end or not | true | | 是否显示行数,行数显示在开始还是结束 | Whether to display the number of lines, whether to display the number of lines on the begin or end | true/begin | | 启动时是否显示激励语 | Show encourage message or not on startup | true |

Github上图片地址:https://raw.githubusercontent.com/Jkssns/picture-bed/main/js-console-setting.png

以后 Future

实用性不大的颜色背景
Add less practical color background

  • Contact us
  • Jobs
  • Privacy
  • Terms of use
  • Trademarks
© 2023 Microsoft