I have a try / catch block that throws an exception and I would like to see the exception information in the Android device log.
I read the mobile device log using this command from my development computer:
/home/dan/android-sdk-linux_x86/tools/adb shell logcat
I tried this first:
try { // code buggy code } catch (Exception e) { e.printStackTrace(); }
but it doesnβt print anything in the magazine. Sorry because it helped a lot.
The best I have achieved:
try { // code buggy code } catch (Exception e) { Log.e("MYAPP", "exception: " + e.getMessage()); Log.e("MYAPP", "exception: " + e.toString()); }
Better than nothing, but not very satisfactory.
Do you know how to print a full back trace in a log?
Thank.
android
dan Dec 03 2018-10-12T00: 00Z
source share