messageLogged
and passes parametersconst EventEmitter = require('events');
const emitter = new EventEmitter();
// Register a listener
emitter.on('messageLogged', function(arg1, arg2) {
console.log('Listener called', arg2, arg1);
});
// Raise an event
emitter.emit('messageLogged', 'arg-first', 'arg-second');