Javascript异常堆栈跟踪 [英] Javascript exception stack trace

查看:119
本文介绍了Javascript异常堆栈跟踪的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Firefox中,我可以使用 exception.stack 获取异常的堆栈跟踪。

In Firefox I can get the stack trace of an exception by using exception.stack.

是否

编辑:我实际上希望自动保存堆栈跟踪(如果可能),而不是调试它(即我知道如何在调试器中获取堆栈跟踪)。

I actually want to save the stack trace automatically (if possible) and not debug it at the time (i.e. I know how to get the stack trace in a debugger).

推荐答案

将此行放在哪里要打印堆栈跟踪:

Place this line where you want to print the stack trace:

console.log(new Error().stack);

注意:由我在 Chrome 24 Firefox 18

可能值得一看此工具

这篇关于Javascript异常堆栈跟踪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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