log-with-namespace-and-date-stamp

1.1.0 • Public • Published

A Simple Log Function with Namespace and Date Stamp

This is a simple log module that write log messages with a date-stamp and a name-space to the standard output (or a specified writable stream, pass it in as the second argument to the generateLogger function).

It is quick and dirty and not optimized for performance.

var generateLogger = require('log-with-namespace-and-date-stamp')
var log = generateLogger('namespace')
 
log('my message')
// -> 2015-02-02 11:35 [namespace] my message

If the last argument is an array the content will be printet in params after the name-space.

var generateLogger = require('log-with-namespace-and-date-stamp')
var log = generateLogger('namespace')
 
log('my message', ['foo', 'bar'])
// -> 2015-02-02 11:35 [namespace] (foo, bar) my message

That is all.

License

MIT

Dependencies (0)

    Dev Dependencies (2)

    Package Sidebar

    Install

    npm i log-with-namespace-and-date-stamp

    Weekly Downloads

    3

    Version

    1.1.0

    License

    MIT

    Last publish

    Collaborators

    • gausby