Created
February 5, 2016 05:55
-
-
Save npgenx/266fb9bce8f013f24f80 to your computer and use it in GitHub Desktop.
js: Trace ( Console.log) Debugger
This file contains 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 trace = { | |
output : false, | |
queue : [], | |
push: function(data){ | |
trace.queue.push(data); | |
if(trace.output){ | |
trace.post(); | |
} | |
return | |
}, | |
post: function(){ | |
$.each(trace.queue, function(i,arr){ | |
trace.log(arr); | |
}); | |
trace.queue = []; | |
return | |
}, | |
dump: function(){ | |
trace.post(); | |
return | |
}, | |
log: function(data){ | |
if (!window.console){ | |
console = { | |
log: function() {} | |
} | |
}; | |
console.log(data); | |
return | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment