Mayank Awasthi
Mayank Awasthi

Reputation: 337

Get the values from console(FIREBUG) using jquery

Is it possible to read the output of console.log with jQuery? I mean if I am getting some value in console(FIREBUG) using console.log, is there a way to get it in a jquery function using some means?

Upvotes: 2

Views: 2007

Answers (1)

ThiefMaster
ThiefMaster

Reputation: 318718

No, but you can simply replace the method with a custom one.

var old_console_log = console.log;
var logged = [];
console.log = function() {
    var args = Array.prototype.slice.call(arguments);
    logged.push(args);
    old_console_log.apply(console, args);
}

Upvotes: 4

Related Questions