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

Discussion in 'B4J Bugs & Wishlist' started by Cableguy, May 11, 2017.

  1. Cableguy

    Cableguy Expert Licensed 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?
  2. Roycefer

    Roycefer Well-Known Member Licensed User

    You might find the jColorLogger library useful.
  3. Cableguy

    Cableguy Expert Licensed User

    From one of the paragraphs on that thread we can read:

    Peter Simpson likes this.
  4. Roycefer

    Roycefer Well-Known Member Licensed 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.
  5. Cableguy

    Cableguy Expert Licensed 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
  6. Erel

    Erel Administrator Staff Member Licensed 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.
  7. Informatix

    Informatix Expert Licensed User

    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.
    GMan, Peter Simpson, cyiwin and 2 others like this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice