try { // some code that throws an exception } catch (Exception e) { Log.wtf("AppTag", "Critical error occurred", e); }
if (someCondition) { Log.wtf("AppTag", "Unexpected condition occurred"); }This example shows how to log a WTF message when an unexpected condition occurs. This could be used, for example, to alert developers to a bug in the application logic. The Log class is part of the android.util package library.