node package manager


Logging utility


Node.js/io.js logging thing.

All log statements log to stdout. Example output follows each log command.

var log = require("floorine");
log.debug("debugging stuff: %s", os.platform());
▫️  DEBUG 2015-02-18 15:12:48 UTC debugging stuff: linux
log.log("normal logging stuff");
▪️    LOG 2015-02-18 15:13:34 UTC normal logging stuff
log.warn("uh oh");
⚠️   WARN 2015-02-18 15:13:44 UTC uh oh
log.error("OH NO!");
🔥  ERROR 2015-02-18 15:13:52 UTC OH NO!

Emoji will probably be rendered differently in your terminal.

The default log level is "log". Use set_log_level() to change it.

var log = require("floorine");
log.log("this will not be logged");
log.error("...but this will be.");
🔥  ERROR 2015-02-18 15:13:52 UTC ...but this will be.

You can also tweak some formatting options. By default, log statements contain an emoji character indicating the level (▫️ , ▪️ , ⚠️ , 🔥) and terminal colors. Use set_config() to change these.

var log = require("floorine");
  emoji: false,
  color: false,
log.error("REALL BORING!");
    LOG 2015-02-18 15:13:52 UTC boring.
   WARN 2015-02-18 15:13:52 UTC boring!
  ERROR 2015-02-18 15:13:52 UTC REALLY BORING!

Values not given will remain unchanged.