log-booster README
log-booster is a simple VS code extension that helps you quickly add log statements to your code.
Made by someone who uses print()
as a debugger. Made for those who use print()
as a debugger.
Installation
Please follow the instructions here for installing this extension.
How to use
Select the variable/expression you want to log and click ctrl+alt+l
if you are on Windows/linux or cmd+alt+l
if you are on MacOS.
Features
- Informs the user if they invoke the extension
- without a focused editor
- on a non python file
- without any selected text
- Log statements follow the same indentation as the line of the selected text
- A shortcut key is provided to invoke the extension
Feature demos:
- Insert log statements before the current line
- Comment all the log statement
- Uncomment all the log statement
- Delete all the log statement
Limitations
- Only works for Python files
- Logging multi-cursor selections won't work. Only the first selection will be logged.
- Cannot invoke the insert before command through the command pallete. It is only accesible via the shortcut key (
ctrl+alt+b
or cmd+alt+b
). For more details, please see this
Contributions
The extension was setup using yo and generator-code by following this guide
I used the following resources to help me develop this extension:
nvm 0.39.1 (optional but recommended)
node.js v16.4.2
npm 8.6.0
If you want to contribute any new features or make the extension better, you can send pull requests on this repository.
Setup
To start developing make sure you installed the recommended versions of npm and node.js. You can use nvm to manage your node.js versions.
Begin with:
> git clone https://github.com/nvinayvarma189/log-booster
> cd log-booster
> npm install
To invoke the extension
- Click
f5
to open the debugging host vscode window
- Invoke the command pallete (
ctrl+shift+p
) on the debugging window and select Log Booster
- Alternatively to step 2, you can also click click
ctrl+alt+l
if you are on Windows/linux or cmd+alt+l
if you are on MacOS.
Development
- Create a new issue here
- Create a new branch for the new feature/bug fix that want to add.
- Edit the
exntension.ts
file and add the new feature/bug fix.
- Create a PR for it here and mention the issue it is solving.