Solved Fix latest.log file to be exactly like console output

Discussion in 'Spigot Help' started by Redstone_Pro_73, May 14, 2016.

  1. So I am having a huge issue where the latest.log is not compared to just looking at the regular console, yet I need these to be exactly or very close to each other (making the latest.log look like the console output).

    Here is the latest.log output:
    [13:43:18] [Async Chat Thread - #2/INFO]: [m[0;32;1m{<[0;37;1m[0;37;1m[[0;31;1mOwner[0;37;1m][0;37;22m ProSnakeMC[m[0;32;1m>} [0;36;1m[21m> [0;37;1mok[m

    But in the regular console (and what I want it to look like) looks like this:
    [13:43:18 INFO]: {<[Owner] ProSnakeMC>} > ok

    I need some way of converting the log file for my (java) application to work. My application is a GUI, NOT a plugin. Thanks
     
  2. Try cat'ing the latest.log from a bash shell - the "weird symbols" actually ANSI color codes.
    Just google for a library that parses these.
     
    • Agree Agree x 1
  3. Thank you very much! This fixed my problem. For other people if they want to figure it out, I just simply added

    .replaceAll("\u001B\\[[;\\d]*m","")

    to the string to remove the ASCI color codes!
     
    • Friendly Friendly x 1