Log.e不打印UnknownHostException的堆栈跟踪 [英] Log.e does not print the stack trace of UnknownHostException
问题描述
在e
是UnknownHostException
的情况下调用Log.e(TAG, "some message", e)
时,不会在logcat上打印堆栈跟踪.
Calling Log.e(TAG, "some message", e)
where e
is an UnknownHostException
, does not print the stack trace on the logcat.
推荐答案
自2011年5月20日以来,Log
类发生了变化,因此不会显示UnknownHostException
异常.
Since May 20, 2011, there is a change in the Log
class, such that UnknownHostException
exceptions are not printed.
这是为了减少应用程序在无错误的情况下记录的日志量 网络不可用的情况. https://github.com/android/platform_frameworks_base/commit/dba50c7ed24e05ff349a94b8c4a6d9bb9050973b>
This is to reduce the amount of log spew that apps do in the non-error condition of the network being unavailable. https://github.com/android/platform_frameworks_base/commit/dba50c7ed24e05ff349a94b8c4a6d9bb9050973b
这篇关于Log.e不打印UnknownHostException的堆栈跟踪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!