Is there a debugging system that allows me to record javascript function calls and their parameters as they occur? this would allow me to trace and debug applications in live/client situations without the performance hit due to manual logging.
Edit: I'm not talking about manually calling functions using a 'console' window and viewing the results, or manually adding 'trace' or 'log' commands into my javascript. I need it to work with any running javascript.
The console. log() is a good way to debug errors but setting breakpoint is a faster, efficient and better method. In this method, Breakpoints are set in code which stops the execution of code at that point so that the values of variables can be examined at that time.
What makes JavaScript great is also what makes it frustrating to debug. Its asynchronous nature makes it easy to manipulate the DOM in response to user events, but it also makes it difficult to locate problems.
But fortunately, all modern browsers have a built-in JavaScript debugger. Built-in debuggers can be turned on and off, forcing errors to be reported to the user. With a debugger, you can also set breakpoints (places where code execution can be stopped), and examine variables while the code is executing.
Can you override Function.prototype.call and retrieve arguments and arguments.callee?
This would have the effect of reporting on ALL functions and therefore being super verbose, but maybe you'd want to filter.
Then you have the question of how you want to report, perhaps with if (console) console.log
you could take a look at http://ajax.dynatrace.com/ajax/en/ - its IE only but pretty darn good, see this article by j. Resig : http://ejohn.org/blog/deep-tracing-of-internet-explorer/ > "..dynaTrace provides some information that I’ve never seen before – in any tool on any browser."
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With