Skip to content

Instantly share code, notes, and snippets.

@jmingov
Created February 25, 2014 06:10
Show Gist options
  • Save jmingov/9203635 to your computer and use it in GitHub Desktop.
Save jmingov/9203635 to your computer and use it in GitHub Desktop.
(function() {
var EventEmitter = events.EventEmitter;
var inspect = util.inspect;
var emit_ = EventEmitter.prototype.emit;
EventEmitter.prototype.emit = function(name) {
var args = Array.prototype.slice.call(arguments);
if (this !== process.stderr && (this.constructor.name === 'pool' || this.constructor.name === 'Pool' || this.constructor.name === 'SMTPConnectionPool' || this.constructor.name === 'SMTPClient')) {
console.log('From:%s Event: %s, arguments: %s', this.constructor.name, name, inspect(args.slice(1), false, 1));
}
return emit_.apply(this, args);
};
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment