0

Wanting to make some output in Logcat or Run more visible, I would like to color it.

But nothing worked, that I found on stackoverflow,

not the ANSI escape codes and

not even System.err.println("Color")!

(See e.g. this question)

Finally I tried: Log.e(TAG, "eeeee") // (TAG needs to be a String)

That worked! It was red.

(Note: Maybe try-catch blocks remove colors.)

But I would like to use more colors, too. Does anyone know how to do it?

Maybe the ANSI escape codes can be used, too. But how?

Looking forward to the answers!

Liggem
  • 1
  • 2

1 Answers1

0

Finally I got more color into my output!

The answers to this question gave me an idea, but did not solve the problem.

In the Preferences... of Android Studio the colors can be changed in Android Logcat. The problem was, that most color values were inherited from the standard output. This needs to be unchecked. Then the colors can be freely changed. And it works!

Now I can use Log.i(...), Log.v(...), Log.w(...), Log.d(...), Log.e(...) in the Java code to get different colors in the output.

Liggem
  • 1
  • 2