Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>colored-clogNew to Visual Studio Code? Get it now.
colored-clog

colored-clog

collinss

|
49 installs
| (2) | Free
[ctrl + alt + o] to log console has random color.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info
clog

colored-clog

A simple extension for logging console with random color.

安装

  1. 打开 VS Code
  2. 点击左侧边栏的 拓展(Extensions) 按钮
  3. 搜索 "colored-clog" 进行安装

功能

1. 快捷键打印,选中变量按下快捷键,自动输出

Mac Windows 功能描述
Control + Option + L Ctrl + Alt + L 按下即输出console.log('🚩 xxx:', xxx)
Control + Option + O Ctrl + Alt + O 按下即输出console.log('%c [xxx]', 'color: #475ad3', xxx)

2. 简写打印,手动输入 log、clg、clog 即可输出

输入 输出(功能描述)
log console.log('🚩 xxx:', xxx)
clg console.log('🚩 xxx:', xxx)
clog console.log('🚩 %c[xxx]:', 'color: blue', xxx)

3. 变量后面添加 .log 即可输出

// example:
const ts = 'test'
ts.log // [clog-d] log object quickly

自定义配置

  1. 打开 VSCode
  2. 点击顶部 文件 > 首选项 > 设置 或者 快捷键访问 Ctrl + ,
  3. 搜索 coloredClog ,点击 在settings.json中编辑
  4. 在 settings.json 配置文件中新增 coloredClog.config,如下所示:
{
   //...
   "coloredClog.config": [
      {
         "prefix": "🚀 ",
         "suffix": "",
         "trigger": "log",
         // "description": "log object quickly",
         // "clogColor": "red",
         // "clogStyle: "background: #237E61; "
      },
      {
         "prefix": "🚀 ",
         "suffix": "",
         "trigger": "warn",
      }
   ]
}

注意事项:

  • 即使配置多个config, .log 的输出方式也仅对配置的第一项(即:coloredClog.config[0] )生效.


For more information

  • Visual Studio Code's Markdown Support
  • Markdown Syntax Reference

Enjoy!

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft