Created
August 10, 2013 14:58
-
-
Save csuwildcat/6200731 to your computer and use it in GitHub Desktop.
Visual logging for mobile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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