a console.log substitution and error handler for mobile device