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 preferred over the other? Is there a functionality difference? Surely they aren't redundant.
Note to future readers: At the time this question was asked, the documentation for this was much less clear. If you follow the link above, they have fixed the problem.
Log. wtf() will log an error with priority level ASSERT, and may (depending on the system configuration) send an error report and terminate the program immediately.
The Log. wtf() method is used to log events that should never happen (“wtf” being an abbreviation for “What a Terrible Failure”, of course). You can think of this method as the equivalent of Java's assert method.
The Logcat window in Android Studio displays system messages, such as when a garbage collection occurs, and messages that you added to your app with the Log class. It displays messages in real time and keeps a history so you can view older messages.
There is a difference in severity;
Log.e()
will simply log an error to the log with priority ERROR.
Log.wtf()
will log an error with priority level ASSERT, and may (depending on the system configuration) send an error report and terminate the program immediately.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With