use eventEmitter for logging