DEV Community

Cover image for Emoji Console Log for VS Code ๐Ÿ•
Artem Sapegin
Artem Sapegin

Posted on

Emoji Console Log for VS Code ๐Ÿ•

Emoji Console Log is my new Visual Studio Code extension to add console.log() statements using a hotkey โ€” my favorite way of debugging web apps.

Image description

Here are the main features of the extension:

  • Hotkeys to add, comment, uncomment, and remove logs to monitor different values.
  • Adds random non-repeating emoji to each log to make it easier to distinguish different logs in the browser console.
  • Automatically detects projectโ€™s code style (quotes, semicolons, tabs/spaces, etc.).
  • Automagically adds new lines at the right places to keep the code neat.

Using console.log() is my favorite way of debugging JavaScript and TypeScript code. Iโ€™ve been trying to learn more fancy techniques, like a debugger, but I always come back to console.log(), because itโ€™s the simplest and it works for me.

The way I do it is by adding a separate log for each variable I want to track, like so: console.log('๐Ÿ• variable', variable). I always add a different emoji at the beginning, so itโ€™s easy to differentiate logs in the browser console.

Try it now in VS Code!

You can also look at the source code on GitHub.

Top comments (0)