Android打印堆栈跟踪 [英] Android print stack trace

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

问题描述

我如何获得与Android中的printStackTrace等效的结果?我知道我可以通过将标记名称和字符串传递给日志记录方法来记录错误,但这只是给了我一个nullpointerexception.如果我调用e.printStackTrace(),此数据将打印到哪里?

How can I get the equivalent of a printStackTrace in android? I know I can log an error, by passing in a tag name and a String to the logging method, but that just gives me a nullpointerexception. If I call e.printStackTrace(), where is this data printed to?

推荐答案

如果您使用的是eclipse,请确保已打开 LogCat 窗口.您可以在

If you are using eclipse make sure you have LogCat window opended. You can find it under

窗口->显示视图->其他->在Android下-> LogCat

更新:2014年7月

或者,如果您使用的是Android Studio,则可以在

OR if you are using Android Studio you can find it under

窗口菜单->显示视图-> Logcat

LogCat 就像普通JAVA中的控制台一样.您的 e.printstacktrace()也将出现在LogCat中.

LogCat is like a console in normal JAVA. Your e.printstacktrace() would appear in LogCat as well.

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

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