I have looked at the documentation for android.util.Log and I\'m not sure exactly what the difference between Log.e() and Log.wtf() is. Is one pref
Official docs say:
Log.e() logs with priority ERROR. However, Log.wtf() logs with priority ASSERT.
ASSERT has priority constant = 7
ERROR has priority constant = 6
So Log.wtf() has higher priority with respect to Log.e()
However source code conflicts with above information.
static int wtf(int logId, String tag, String msg, Throwable tr,boolean localStack, boolean system) {
TerribleFailure what = new TerribleFailure(msg, tr);
// Only mark this as ERROR, do not use ASSERT since that should be
// reserved for cases where the system is guaranteed to abort.
// The onTerribleFailure call does not always cause a crash.
int bytes = printlns(logId, ERROR, tag, msg, localStack ? what : tr);
...
}
It looks like there is a mistake in Official docs. Because both Log.wtf() and Log.e() logs with priority ERROR.
Source Code for Log.e():
public static int e(@Nullable String tag, @Nullable String msg,@Nullable Throwable tr) {
return printlns(LOG_ID_MAIN, ERROR, tag, msg, tr);
}
The difference is that Log.wtf() might call onTerribleFailure() call back.
onTerribleFailure() may or may not cause the process to terminate (depends on system settings).
TL;DR
Log.wtf() might call onTerribleFailure() and can cause termination of your application.