Patched logging to redirect browser messages to console