Unfortunately using breakpoints in that way would be far too slow -- it's an "overloaded" variadic function that's called a number of times in rapid succession, each time with a different number of arguments of differing types. What I like about the pure-Console approach (like Function Logging) is that all the calls and arguments flow down in rapid, near-real-time fashion. (BTW, I know there's technically no such thing as an "overloaded function" in JS, but you probably know what I mean.)
I just tried something else, very simple. Within the function body, I put this:
console.log( arguments );
Interestingly, this gives me both more and less information than Function Logging. On the downside, it doesn't show the
name of each parameter; but on the upside, it shows what the
value of some of the parameters are. An actual example, for a single iteration of the function call, should make this clear...
Here's what Firebug's Function Logging shows:
waitForElm(elmTrigger="textCol", actionToExecute=Object { type="object"}, arrayOrSrc=Object { type="object"}, bg=undefined)
For the exact same call, here's what using console.log(arguments) shows:
["textCol", setupAnimToggle(animID, animSrc, posterFrame, animSwitch, offCaption, onCaption, initialState), ["mastheadAnim", "EssayMasthead.anim.gif", "EssayMasthead.posterFrame.gif", 4 more...]]
In addition to not showing the parameter name (e.g. Logging's
elmTrigger="textCol" is better than just "textCol") this has a few other shortcomings:
1. It jumbles all the parameters together, rather than listing them vertically as #0, #1, #2, etc, which would be much clearer. Ideally, the parameter number AND name AND value should be shown.
2. It doesn't give the parameter types. Some are obviously strings, and (for example) I happen to know that "setupAnimToggle" is a function, and that its arguments came in from an array via 'function.apply', but this listing doesn't indicate any of that.
3. For some reason it doesn't give the complete list, truncating it to "4 more...". (Playing around, I discovered that I can get to the full list with 2 more clicks, which takes me to the DOM tab, and then I can manually switch back to the Console tab -- OK but not ideal. Why does it truncate the list of parameters?)
Perhaps there's some expansion or variation on
console.log(arguments) that would deal with some of these shortcomings? Some custom console function that would combine the best features of Function Logging with
console.log(arguments)? Either approach (or combining the two, which I'm doing right now but is rather cluttered) seems incomplete, but still better than slogging through breakpoints. However, perhaps someone has an idea for a custom function (to be nested within the real function inside of a console.log) that would give a more complete readout?
Thanks much!