Showlog.js

Show console.log messages on screen

Achraf Kassioui
showlog.js 1.5KB minified Github repository

Setup

Include the JavaScript file in HTML:

<script type="text/javascript" src="showlog.js"></script>

Showlog will start automatically.

Usage

Use console.log as usual and the message will get displayed on screen. For example, this page console logs the (x, y) coordinates of the user pointer.

The number> before the angle bracket is a counter. It counts how many times logging has been called and it helps discriminate between consecutive messages.

Options

Stop logging messages on screen with the stop method:

showlog.stop();

Start logging messages on screen with the start method:

showlog.start();

Display messages on screen only with the log method:

showlog.log('Hi');

A boolean attached to showlog tells whether Showlog is running or not:

showlog.running
False

Why Showlog

I needed to debug JavaScript code on mobile. I had the following requirements:

License

Showlog.js is published under the GNU General Public License.