emit-logger

0.1.0 • Public • Published

emit-logger

Event logger for EventEmitter.

Installation

npm:

$ npm install emit-logger

Usage

Example:

var Emitter = require('events').EventEmitter;
var EmitLogger = require('emit-logger');
var logger = new EmitLogger();

var emitter1 = new Emitter();
emitter1.toString = function() {
  return 'emitter 1';
};

var emitter2 = new Emitter();
emitter2.toString = function() {
  return 'emitter 2';
};

logger.add(emitter1);
logger.add(emitter2);

emitter1.on('foo', function() {
  console.log('foo!');
});

emitter1.emit('foo', 'hello', 'world');

setInterval(function() {
  emitter2.emit('random', Math.random());
}, 500);

screenshot

License

The MIT License

Copyright (c) 2013 Circuit Lab. <info@uniba.jp>

Dependencies (0)

    Dev Dependencies (2)

    Package Sidebar

    Install

    npm i emit-logger

    Weekly Downloads

    1

    Version

    0.1.0

    License

    none

    Last publish

    Collaborators

    • nulltask