Frage

I am developing an android app using eclipse. How to see printstacktrace's output?

War es hilfreich?

Lösung

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

Andere Tipps

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

Opening Logcat in eclipse

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.

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.

to see printstacktrace's output..

Use Log class methods.. like Log.i, Log.v etc..

To see Log output go to DDMS > LogCat

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top