Overloaded method logMessage. It now can call certain listeners instead of doing a broadcast to all listeners.
Requires additional parameter (Listener listener).