Attaches a listener for the log, and calls the passed function for each log entry.
a function to cancel the listener.
Attaches a listener for the log, and calls the passed function for each log entry.