An easy to use Vscode extension, which provides a faster way to create logs.
Just select a variable and use the keyboard shortcut to quickly create a log of it.
You can customize the keyboard shortcut for using this extension according to your preferences. Here's how:
- Install the extension (if you haven't done it already).
- Open Visual Studio Code.
- Go to
File
>Preferences
>Keyboard Shortcuts
, or pressCtrl + K Ctrl + S
. - Search for "extension.easy-log" in the search bar.
- Hover over the rightmost side of the row, where it says "unassigned", and click on the "+" icon that appears.
- This will open a new input box. Press your desired key combination for the shortcut.
- After pressing the key combination, VSCode will ask you to enter a snippet name. Enter
logVar
(or whatever prefix you've used for your snippet). - Press
Enter
to confirm.
That's it! You've customized the keyboard shortcut for using this extension. Now all you need to do is select a text and use the new keyboard shortcut to create logs
You can customize the sign used in the log message by modifying the extension settings:
- Open Visual Studio Code.
- Go to
File
>Preferences
>Settings
, or pressCtrl + ,
. - Search for "Easy Log Sign" in the search bar.
- Choose your desired sign from the dropdown menu:
- Arrow (=>)
- Colon (:)
- None (No sign)
Additionally, you can specify the log type (log, warn, error) by selecting the appropriate option from the "Easy Log Type" dropdown menu.