Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including itslog with all npm packages installed. Try it out:

var itslog = require("itslog")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

itslog v1.2.4

It's Log

It's better than bad, it's good!


I work in environments with heaps of console spam, making it annoying to find my own logs in the haystack. This package lets you prefix all your logs with a stylish identifying string without changing the function signature of your console methods.

Before: before

After: after


CD into your project folder and install the package.

npm install itslog --save

Require the Package

Now that you've installed the package, you've got to require it in your code. You can do that like this:


import itslog from 'itslog';

CommonJS Style:

const itslog = require('itslog');

For browser people with no build system, this package creates a global variable called ItsLog if no other module loading system is available. Oh, you can also use AMD. I'm not gonna put an example here, you get the point. It's a UMD module with a global as a backup.

Usage Instructions

const console = itslog('test');

// Simple methods.

// Complex methods.
console.assert(someVar === someOtherVar, 'log');
console.table(["let's", "make", "a", "table"]);

Simple methods will prepend your prefix to the arguments. Complex methods will log your prefix and then invoke whatever function you really wanted to call. This is because a random string at the beginning of, say, a table doesn't make any sense.


RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free