Grabber
To hijack the consoles with tags on them.
by shriek
JavaScript
function grabber(tag) {
var tag = tag;
var old = console.log;
window.log = [];
(function() {
console.log = function() {
if (arguments[0].match(tag, "i")) {
debugger;
Array.prototype.shift.call(arguments);
Array.prototype.forEach.call(arguments, function(arg) {
window.log.push(arg);
});
old.apply(this, arguments);
} else {
debugger;
old.apply(this, arguments);
}
}
}());
}