0.0.2 • Published 10 years ago

contextual-logger v0.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
10 years ago

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.