contextual-logger

0.0.2 • Public • Published

node-contextual-logger

Small and fast NodeJS logger with datetimestamp and prefixed context just because.

Install

npm install contextual-logger

Usage

Hold onto your socks now.

var logger = require('contextual-logger')().log;
var prefixedLogger = require('contextual-logger')('[PREFIX]').log;

var a = 'Hey girl.', b = { smooth: 'water' }

logger('Hello world.', a , b);
    //-> [2014-07-05T17:59:24Z] Hello world. Hey girl. { smooth: 'water' }
    
prefixedLogger('Hello world.', a , b);
    //-> [2014-07-05T17:59:24Z] [PREFIX] Hello world. Hey girl. { smooth: 'water' }

References:

NodeJS implementation of console.log

For padded datetime stamp

Credits

Links

License

Copyright (c) 2014 Hafiz Ismail. This software is licensed under the MIT License.

Package Sidebar

Install

npm i contextual-logger

Weekly Downloads

4

Version

0.0.2

License

MIT

Last publish

Collaborators

  • sogko