android - Log.wtf()跟Log.e() 这两个函数有什么区别
PHP中文网
PHP中文网 2017-04-17 17:16:08
[Android讨论组]

试了一下好像打印的东西都是一样的

PHP中文网
PHP中文网

认证0级讲师

全部回复(4)
PHP中文网

恩。。wtf的意思是what a terrible failure
可怕的失败:报告一个永远不可能发生的情况。

然后这是官方原文:

What a Terrible Failure: Report a condition that should never happen. The error will always be logged at level ASSERT with the call stack. Depending on system configuration, a report may be added to the DropBoxManager and/or the process may be terminated immediately with an error dialog.

大概是用来打印正常情况下永远不会发生bug?

ps:不是what the fuck哈_(:з」∠)_

巴扎黑

错误级别不同,Log.e代表错误级别的日志,Log.wtf是中断(ASSERT)级别的错误,毕竟是What The Fuck,一看就是严重BUG才骂街了。

高洛峰

Log.e就是单纯的错误。
Log.wtf会优先断言(ASSERT),而且,如果你配置了的话,会生成一个错误报告,然后程序就结束啦。

伊谢尔伦

官方文档:
wtf:
What a Terrible Failure: Report a condition that should never happen. The error will always be logged at level ASSERT with the call stack. Depending on system configuration, a report may be added to the DropBoxManager and/or the process may be terminated immediately with an error dialog.


e:
Send an ERROR log message.

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号