Skip to content

Instantly share code, notes, and snippets.

@namklabs
Created August 22, 2020 23:06
Show Gist options
  • Save namklabs/89429c744d3efa2610d37bd385a0ea30 to your computer and use it in GitHub Desktop.
Save namklabs/89429c744d3efa2610d37bd385a0ea30 to your computer and use it in GitHub Desktop.
replace console warn/error with alert for devices where console is not easily accessible
console.oldwarn = console.warn;
console.warn = (...args) => {
alert([...args].join(' '));
console.oldwarn.call(null,...args);
}
console.olderror = console.error;
console.error = (...args) => {
alert([...args].join(' '));
console.olderror.call(null,...args);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment