Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>vscode-logNew to Visual Studio Code? Get it now.
vscode-log

vscode-log

odinlin

|
45 installs
| (0) | Free
Visual Studio Code extension to outputting of log statements in various language files
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

vscode-log

Visual Studio Code extension to outputting of log statements in various language files.

Installing

This extension is available for free in the Visual Studio Code Marketplace

Usage

With selection (single or multiple selections):

  • Highlight a variable (or really any text)
  • Press Cmd+Shift+L
  • The output (on a new line) will be: console.log('{format}', variable);

Without selection:

  • Press Cmd+Shift+L
  • The output (on the same line) will be: console.log('{format}', );

Configuration

  • pr

If you want to add log statements for your commonly used language, please modify both options.ts and README.md files at the same time.

{
  /** variables: {fileName}, {line} */
  "format": "[vscode-log] {fileName}@Line {line}: ",

  /**
   * language files
   * NOTICE: 必须对特殊符号进行转义,eg: 引号、换行符等
   */
  "/javascript|typescript|vue|html|svelte/": "console.log(\"{format}\", {selection});",
  "/go/": "fmt.Printf(\"{format}%#v\\n\", {selection})"
}
  • local

Assigning vscode-log.options in {User}/settings.json can override defaultOptions.

{
  "vscode-log.options": {
    "/go/": "fmt.Printf(\"{format}%#v\\n\", {selection})"
  }
}

License

MIT License

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