Changed javascript logging into an event

Is there a reason why we don't always want to emit the log event. It won't do anything if there aren't any registered listeners on it.