Skip to content

About

A great extension with several features to manage console.log in js

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

ConLogs by Avertry

CREDITS: Thanks to M-coder, for the original extension.

Easily insert and comment console.log statements.

It's true, there are already a lot of extensions to write console.logs quickly and I have used some. However, as I used it I felt a need to add some small features so that the extension suited me perfectly.

Here are some of the available features:

  • writes a console.log just by placing the cursor on the word (without needing to select it).
  • automatically detects if the file is encoded with semicolons.
  • manages the indentation in an optimized way (a bit complicated to explain in one line but do the experiment)
  • if you select an object with its curly brackets, the extension logs the whole object. Destructured objects and arrays continue to write a separate console.log for each item.
  • allows to toggle comments on all console.log statements in a file with one keyboard shortcut
  • removes both active and commented console.log statements from a file
  • if the cursor is not placed on text then it will simply write "console.log()"

Sample with variables: Sample with variables



Sample with object: Sample with object

Installing

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

Usage

Write console.logs:

With cursor over the word or selection:

Press Cmd+Shift+L => The output (on a new line) will be: console.log('variable: ', variable);

Without selection:

Press Cmd+Shift+L => The output (on the same line) will be: console.log();

Comment all console.logs:

Press Cmd+Shift+C => This toggles comments on all console.log statements in the current file.

Remove all console.logs:

Press Cmd+Shift+D => This removes all active and commented console.log statements in the current file.

License

MIT License

About

A great extension with several features to manage console.log in js

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages