0.2.3 • Published 10 years ago

stream-log v0.2.3

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

stream-log

a tiny stream logger.

Installation

$ npm install stream-log

Example

npm.io

var Logger = require('./');
var logger = new Logger(process.stderr);
var types = ['info', 'install', 'fetch', 'fetching'];
var times = 20;

types.forEach(function(type){
  logger.type(type, '36m');
});

logger.type('error', '31;1m', function(){
  logger.end();
  process.exit(1);
});

var i = setInterval(function(){
  var type = types[Math.random() * 4 | 0];
  --times && logger[type]('user/package@1.0.0');
  times || end();
}, 10)

function end(){
  clearInterval(i);
  logger.error(new Error('boom!').stack);
}

License

(MIT)

0.2.3

10 years ago

0.2.2

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.1

10 years ago

0.0.0

10 years ago