Skip to content

Instantly share code, notes, and snippets.

@tlowrimore
Created September 9, 2020 18:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tlowrimore/bee2580882f6eb23797e2ed0d319c4ad to your computer and use it in GitHub Desktop.
Save tlowrimore/bee2580882f6eb23797e2ed0d319c4ad to your computer and use it in GitHub Desktop.
A janky-ass console logger for debugging web apps in iOS Safari, when you don't just have a Mac lying around for accessing a debug console.
function jankylog(msg) {
let konsole = document.getElementById('jankylog');
if(!konsole) {
konsole = document.createElement('pre');
konsole.id = 'jankylog';
konsole.style.backgroundColor = 'white';
konsole.style.padding = '1rem';
document.body.append(konsole);
}
konsole.append(`>>> ${JSON.stringify(msg, undefined, 2)}\n`);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment