Wish LogColor... why it never got to b4j?

Cableguy

Expert
Licensed User
Longtime User
Hi Erel....

I found myself trying to use LogColor in my B4J apps... Of course, it doesn't work, simply because it does not exist in B4J... Any reason Why?
Any Workaround?
 

Cableguy

Expert
Licensed User
Longtime User
You might find the jColorLogger library useful.
From one of the paragraphs on that thread we can read:

The color functionality doesn't work in the B4J IDE but the logging still does, it just appears as boring monochromatic text
 

Roycefer

Well-Known Member
Licensed User
Longtime User
It's a simple matter to run your program outside the IDE in a terminal window (perhaps via batch file).

You can also use LogError in the IDE, but that only gives you red.

I think these are the only ways to display color in the console output of a B4J program.

If Erel would make the Logging TextField in the IDE compliant with ANSI escape codes, jColorLogger would display color in the IDE. And he could easily implement a LogColor method. NetBeans has this feature.
 

Cableguy

Expert
Licensed User
Longtime User
I believe that, since the B4x suite uses the same base IDE, it wouldn't be too difficult to implement a similar solution as in B4A
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Any reason Why?
The assumption in B4A and B4i is that you will only (or mostly) read the logs from the IDE. So it is not problematic to add all kinds of metadata to the logs. The IDE reads the metadata and removes it.
This is not the case in B4J. The logs can be useful in many cases while running the app in production. So B4J doesn't add any metadata to the logs.

It might be added in the future.
 

Informatix

Expert
Licensed User
Longtime User
The assumption in B4A and B4i is that you will only (or mostly) read the logs from the IDE. So it is not problematic to add all kinds of metadata to the logs. The IDE reads the metadata and removes it.
This is not the case in B4J. The logs can be useful in many cases while running the app in production. So B4J doesn't add any metadata to the logs.

It might be added in the future.
For people like me using only Log() for debugging, LogColor is really missing. I use LogError when I need to display the line in red, but it's not enough.
 
Top