通过记录函数调用和参数来进行javascript调试 [英] Live javascript debugging by recording function calls and parameters

查看:167
本文介绍了通过记录函数调用和参数来进行javascript调试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一个调试系统,允许我记录javascript函数调用及其参数,当它们发生时?这将允许我在现场/客户端情况下跟踪和调试应用程序,而不会因手动记录而导致性能下降。



编辑:不是在谈论使用控制台窗口手动调用函数并查看结果,或者手动将trace或log命令添加到我的javascript中。我需要它使用任何运行的javascript。

解决方案

可以覆盖Function.prototype.call并检索参数和arguments.callee ?



这将有效地报告所有功能,因此是超级冗长的,但也许您想要过滤。



然后你有你想要报告的问题,或许if(console)console.log


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.

解决方案

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

这篇关于通过记录函数调用和参数来进行javascript调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆