The `DEBUG=*page npm run unit` is too verbose due to events spamming the console. This patch starts tracing emitted events only if there are any listeners.