I would like to override console.log and call it on my new function.
I try something like this but I get Uncaught TypeError: Illegal invocation:
Uncaught TypeError: Illegal invocation
One little point... console.log can receive multiple arguments, for example:
console.log
console.log('results', result1, result2, result3);
If you want this behavior, you can do something like this:
console.log = function(){ var args = Array.from(arguments).join(' '); ... }