util-logging

0.0.1 • Public • Published

util-logging#

Usage:

//load the module
var log = require("util-logging");
 
//create a logger, and set its logging level
var logger =  new log.ConsoleLogger().setLevel(log.Level.INFO);
 
//log some a simple message 
logger.info("Message at info level");
 
//log an error by itself
logger.info(new Error("Cannot compute!"));
 
//log and error accompanied by a message
logger.info("An error has occurred!", new Error("Cannot compute!"));
 
//log an object
logger.info({"key1": "value1"});
 
//log a formatted message
logger.info("Today is %s", new Date());
 
//log a formatted message with multiple replacements
logger.info("Hello %s, and %s", "foo", "bar");

Dependencies (0)

    Dev Dependencies (1)

    Package Sidebar

    Install

    npm i util-logging

    Weekly Downloads

    2

    Version

    0.0.1

    License

    none

    Last publish

    Collaborators

    • micovery