Log.e does not print UnknownHostException stack trace

Calling Log.e(TAG, "some message", e) , where e is an UnknownHostException , does not print the stack trace to logcat.

+6
source share
2 answers

Starting May 20, 2011, a change to the Log class occurs, so that UnknownHostException exceptions UnknownHostException not UnknownHostException .

This means that the number of errors in the logs that applications make in the event of an error the network state is not available. https://github.com/android/platform_frameworks_base/commit/dba50c7ed24e05ff349a94b8c4a6d9bb9050973b

+9
source

Incoming e useless, delete it and it will be visible in logcat .

 Log.e(TAG, "some message"); 
-3
source

Source: https://habr.com/ru/post/983418/


All Articles