在日志中打印布尔值 [英] Print the value of a boolean in Log
本文介绍了在日志中打印布尔值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是否可以在日志消息中打印从方法返回的布尔值?我能够打印字符串值,但是我不确定如何在日志消息中打印布尔值.
Is it possible for me to print the Boolean value returned from a method in a Log message? I am able to print String values, but I am not sure how to print Boolean values in Log message.
推荐答案
是.
Log.v("", "" + booleanValue);
或
Log.v("", Boolean.toString(booleanValue));
这篇关于在日志中打印布尔值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文