Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

printing values of variables in logcat for debugging in android

Tags:

android

logcat

I have variables/fields in my activity which are of type float.Is there any way to log there values in logcat as Log.w,Low.v,Log.i are not helping me...

like image 837
Ruchira Avatar asked Oct 10 '11 20:10

Ruchira


People also ask

What is verbose in Android Logcat?

The tag of a log message is a short string indicating the system component from which the message originates (for example, "View" for the view system). The priority is one of the following character values, ordered from lowest to highest priority: V : Verbose (lowest priority) D : Debug.


2 Answers

Log.d("ADebugTag", "Value: " + Float.toString(myFloatVar)); 
like image 107
aromero Avatar answered Oct 06 '22 11:10

aromero


Log.d("tag", "Value: " + float); it will convert to string

like image 33
vuhung3990 Avatar answered Oct 06 '22 13:10

vuhung3990