Easily insert and remove log.(Printf|Println|Print) in go files
Credit to javascript-console-utils
Published and distributed on the VSCode Marketplace
In any .go
file,
With selection:
- Highlight a variable, or multiple variables (works best if they are on the same line)
- Press Cmd+Shift+L (Mac) or Ctrl+Shift+L (Windows)
- The output on a new line will be:
log.Printf("variables: %v...", variables...)
Without selection:
- Press Cmd+Shift+L (Mac) or Ctrl+Shift+L (Windows)
- The output on a new line will be:
log.Printf()
To remove logs:
- Press Cmd+Shift+D (Mac) or Ctrl+Shift+D (Windows)
- This will delete all
log.(Printf|Println|Print)
statements in the current active document
- Configuration option for deleting other log statements, such as
log.Fatal
,log.Panic
etc.
Please contribute!
MIT © 2020 gpng