java:打印当前回溯
有没有办法在Java中添加命令来添加当前的回溯?
我正在编写一个 red5 应用程序,并且 appDisconnect 函数被调用两次。每当用户更换房间时。我想在 appDisconnect 函数的开头添加一个函数,显示当前的回溯,然后我可以看到调用它的内容。
谢谢
is there a way to add a command in Java to add the current backtrace ?
I'm writing a red5 application and the appDisconnect function is being called twice. whenever a user changes room. I want to add a function at the beginning of the appDisconnect function that shows the current backtrace and then I can see what called it.
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以将堆栈跟踪输出到当前行,如下所示:
或者,如果您需要编程访问可以使用的堆栈跟踪元素
You can output the stack trace to the current line like this:
Or if you need programmattic acces the the stacktrace elements you can use
我知道的唯一方法是查看:
尽管这听起来更像是一个日志记录问题,而不是实际观察调用跟踪。您还可以尝试在 IDE 中设置
debug
执行并添加一些适当的断点。The only way I know of is to look at:
Although this sounds more like a
logging
issue than actually observing the call trace. You could also try to setupdebug
execution in your IDE and add a few well placed breakpoints.