How to use printstacktrace in Java( Eclipse, android)?

风流意气都作罢 提交于 2019-12-06 15:33:42

printstacktrace's output can be seen in the DDMS ->Logcat view

Please use Log for printing Log's.The message types, and their related method calls are:

The Log.e() method is used to log errors.

The Log.w() method is used to log warnings.

The Log.i() method is used to log informational messages.

The Log.d() method is used to log debug messages.

The Log.v() method is used to log verbose messages.

The Log.wtf() method is used to log terrible failures that should never happen. (“WTF” stands for “What a Terrible Failure!” of course.)

To see Log output go to DDMS > LogCat

In android development on eclipse, better use logcat. In eclipse, go to Window/Show View/Other... and choose Logcat under Android from the dialog.

When you start your app in debug mode, all messages will be logged there. You can use filters to hide messages from system or other apps.

Hardik Joshi

In Android you should prefer Log class methods to the printStackTrace(). You can see Log output inside the logcat in the DDMS. Hope this helps.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!