JAVA应用程序如何打印出自己的回溯栈

 

Use the below code have the JAVA dump the stack:

new RuntimeException("stack").printStackTrace();

 

 

The log is like:

08-24 16:29:00.700 W/System.err( 1542): java.lang.RuntimeException: stack

08-24 16:29:00.700 W/System.err( 1542):    at com.android.server.AlarmManagerService.setLocked(AlarmManagerService.java:436)

08-24 16:29:00.700 W/System.err( 1542):    at com.android.server.AlarmManagerService.setRepeating(AlarmManagerService.java:182)

08-24 16:29:00.700 W/System.err( 1542):    at android.app.IAlarmManager$Stub.onTransact(IAlarmManager.java:84)

08-24 16:29:00.700 W/System.err( 1542):    at android.os.Binder.execTransact(Binder.java:320)

08-24 16:29:00.700 W/System.err( 1542):    at dalvik.system.NativeStart.run(Native Method)

08-24 16:29:00.720 E/AlarmManagerService( 1542): hebo:set alarm to 1314203704.904000000, type=0

你可能感兴趣的:(JAVA应用程序如何打印出自己的回溯栈)