Reputation: 1493
I have an ant build that runs gcc. When run in isolation gcc outputs bash colour codes to enhance the output, making it far more readable than monochrome text.
These colour codes are getting lost as the output passes through ant; I have tried running ant with -logger org.apache.tools.ant.listener.AnsiColorLogger
, but that just controls the colours, it doesn't pass through codes from the task.
Is there any other logger or option that can enable this facility? If not, I could create a custom logger, but I don't understand why a colour code byte sequence doesn't work when it's passed through ant; what would a custom logger have to do differently to allow them to work?
Upvotes: 1
Views: 550
Reputation: 1493
I've confirmed that the loss of colouring was caused by gcc
, since it will only output colours when stderr
is a terminal. Since ant reads gcc output via a pipe, the colouring became suppressed.
Fix is to pass -fdiagnostics-color=always
to gcc
.
Upvotes: 1