Skip to content

Instantly share code, notes, and snippets.

@csuwildcat
Created August 10, 2013 14:58
Show Gist options
  • Select an option

  • Save csuwildcat/6200731 to your computer and use it in GitHub Desktop.

Select an option

Save csuwildcat/6200731 to your computer and use it in GitHub Desktop.
Visual logging for mobile
var msg = document.getElementById('msg');
var msgs = [];
var log = function(m, e){
if (e) console.log(e);
msgs.unshift(m + ' ' + new Date().getTime());
msgs = msgs.slice(0,5);
msg.innerHTML = msgs.join('<br/>');
};
var logEvent = function(e){
log((e.target.id || e.target.nodeName) + ' ' + e.type, e);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment