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 kenny-loggins with all npm packages installed. Try it out:

var kennyLoggins = require("kenny-loggins")

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

kenny-loggins v0.0.1

Highway to the logging zone

Kenny Loggins

Yet another logging library

Whirlwind Tour (will get better later I promise)

var loggins = require('kenny-loggins');'oh hey'); // totally cool!

The default loggins is already piped to stdout, but if you want a clean one go for it:

var kenny = loggins();


It takes an optional arguments hash with values:

  • opts.levels: Either a list of levels, or key-value pairs of the form <level>: <color>.

This returns a stream which outputs pretty-printed logging events.

logger will have a method for every level. For example:'this is some info'); is also a readable/writable stream. As a writable stream, it will log each chunk as a logging message. As a readable stream, it just emits the log messages.

logger.raw is the same as 'logger' except the chunks are in JSON format.

logger._pretty is used to format an object with the keys "level" and "message". You can punch this to customize what prettiness looks like. By default colorizes the message if logger.colors[level] is defined, using some copypasta from the colors library to avoid punching the prototype (looking for a better solution!!!).

Other Things

  • Works in browserify, even with the same text colors as the console
  • logger.logging is a [](logref hook)


  1. Way way way better docs
  2. Special cases for formatting errors?
  3. Unpipe?




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