Attaches a listener that writes log entries to the console as they come in.
a function to cancel the listener.
Attaches a listener that writes log entries to the console as they come in.