Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

why print null string in android Logcat show nothing?

Tags:

android

logcat

when I debug using a Log, however with a message of null string(not space just like "") by coincidence, and the results show nothing even no empty colorful logcat row, that is to say, if I want to execute Log.d(TAG, msg) but the string msg is a null character(msg.equals(""); it show nothing in DDMS , so I have to append some other characters as a mark to guarantee the log row to appear for check. Is there other approach to handle this issue? Appriciate a lot

like image 903
user1611552 Avatar asked Nov 12 '22 12:11

user1611552


1 Answers

Usually it's helpful to print something that describes what your String variable is supposed to mean, so why not do something like:

Log.d(TAG, "my message: " + msg);
like image 117
mpellegr Avatar answered Nov 15 '22 06:11

mpellegr