Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable cyan coloring in build output when --console=plain is used. #2764

Closed
mpeddada1 opened this issue Sep 16, 2020 · 7 comments · Fixed by #3087 or #3129
Closed

Disable cyan coloring in build output when --console=plain is used. #2764

mpeddada1 opened this issue Sep 16, 2020 · 7 comments · Fixed by #3087 or #3129

Comments

@mpeddada1
Copy link
Contributor

No description provided.

@chanseokoh
Copy link
Member

Affects both Maven and Gradle. Doesn't matter if it's --console=plain (Gradle), --batch-mode (-B) (Maven), or -Djib.console=plain.

We should also clean up code that we introduced in JibPluginTest to remove color sequence from a string.

String cleanOutput = output.replace("\u001B[36m", "").replace("\u001B[0m", "");

Details: #2739 (comment)

There may be more places where we color output.

@dinvlad
Copy link

dinvlad commented Jan 11, 2021

Any updates here? Thanks

EDIT: TERM=dumb doesn't work either..

@chanseokoh
Copy link
Member

It's a low priority although I think it's an easy fix. We're pretty overloaded, and we'd appreciate contributions. 😄

@dinvlad
Copy link

dinvlad commented Jan 11, 2021

Thanks for the update! In the meantime, I was able to work around it using

./gradlew jib --console=plain | perl -pe 's/\x1b\[[0-9;]*[mG]//g'

@vinod-tahelyani
Copy link
Contributor

@chanseokoh I would like to take this.
One simple solution that I have is to replace "\u001B[36m" and "\u001B[0m" with "", here

consoleLogger.log(logEvent.getLevel(), logEvent.getMessage());

or if there is any way to access ConsoleOutput from

successMessageBuilder.add(colorCyan(targetImageReference.toString()));

??

@mpeddada1
Copy link
Contributor Author

mpeddada1 commented Feb 22, 2021

Hey @vinod-tahelyani, thanks for looking into this! We were thinking that this change could be even more effective if there was a way to filter out any color (not just cyan) in the PlainConsoleLogger? This would allow us to touch all parts of the code that use the plain console output. Looking at this stackoverflow link, it seems like most colors follow a similar regex pattern.

@chanseokoh
Copy link
Member

Reopening to track the cleanup task: #2764 (comment)

@chanseokoh chanseokoh reopened this Mar 11, 2021
mpeddada1 added a commit that referenced this issue Mar 12, 2021
* resolve TODO

* Update CHANGELOGs for jib-gradle-plugin anf jib-maven-plugin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment