Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does Log.wtf() differ from Log.e()?

Tags:

android

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.

like image 437
gobernador Avatar asked Mar 01 '12 21:03

gobernador


People also ask

What does log wtf do?

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.

What is a log wtf Android?

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.

What is the use of log in Android?

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.


1 Answers

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.

like image 150
Joachim Isaksson Avatar answered Sep 28 '22 01:09

Joachim Isaksson