DEV Community

Cover image for Using console.log() on any website? Logpoints let you do that!
Christian Heilmann
Christian Heilmann

Posted on • Originally published at christianheilmann.com

Using console.log() on any website? Logpoints let you do that!

If you want to know the value of a certain expression in any JavaScript on the web, you can use logpoints for that. It is like injecting a console.log() anywhere you want.

Here's a quick demo:

Here's how the demo works:

  1. Open https://codepo8.github.io/dog-browser/ in the browser
  2. Open Developer Tools, go to the Sources tool
  3. Locate walkies.js and open it
  4. Right-click the line number where you'd like to add a logpoint - in this case line 57
  5. Select Add logpoint to open the editor
  6. In the Editor, enter the expression that you'd like to log - in this case data.
  7. Hit Enter to save and a badge shows on the line number.
  8. Go to the Console, interact with the site and every time line 57 executes, you see the result of the logpoint expression to the console.

You can set as many logpoints as you want. Clicking the badge again removes them.

Top comments (0)