how to log an integer value with log.d?

I prefer String.valueOf(value).

Log.d(String.valueOf(backgroundColorRandomize()), "value = " + randomRGB);

Log.d("MYINT", "value: " + randomRGB);

private static final String TAG = YourClass.class.getSimpleName();

...

android.util.Log.d(TAG, String.format("value = %d. random color = %d", randomRGB, backgroundColorRandomize()));

More info:

  • http://developer.android.com/reference/android/util/Log.html
  • https://developer.android.com/tools/debugging/debugging-log.html

Logging libraries: https://android-arsenal.com/tag/57

Tags:

Java

Android