intercept console method calls and write to the browser