Log.e不打印UnknownHostException的堆栈跟踪 [英] Log.e does not print the stack trace of UnknownHostException

查看:51
本文介绍了Log.e不打印UnknownHostException的堆栈跟踪的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

eUnknownHostException的情况下调用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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆