Changed log to emit an event instead