Follow up question to the solution posted here:
Adding console.log to every function automatically
This works great for getting the name of the function called:
function augment(withFn) {
var name, fn;
for (name in window) {
fn = window[name];
if (typeof fn === 'function') {
window[name] = (function(name, fn) {
var args = arguments;
return function() {
withFn.apply(this, args);
return fn.apply(this, arguments);
}
})(name, fn);
}
}
}
Can you also list the arguments supplied to the function that was called?