Libs:
JSBridge
jQuery
jQuery Message Queuing
Code:
JSBridge
jQuery
jQuery Message Queuing
Code:
// logging via JSBridge
function log(msg) {
var logObj = new JSBridgeObj();
logObj.addObject("message",msg);
logObj.addObject("task", "log");
logObj.sendBridgeObject();
}
// create and configure queue
// set delay for 20ms
var logQ = $.jqmq({
delay:20,
batch:1,
callback:function(item) {
log(item);
return false;
},
complete:function() {
log("logQ done");
},
paused:false
});
// overwrite console.log
var console = new Object();
console.log = logQ.add;
console.debug = console.log;
console.info = console.log;
console.warn = console.log;
console.error = console.log;
Comments
Post a Comment