Add -no-color option
See original GitHub issueCommunity Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave “+1” or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
Description
Please add the option -no-color
to cdk.
A lot of users run cdk in a context where the output is not rendered by the system, but instead used for further computation or redirected to other sinks, that cannot interpret terminal formatting. The additional formatting strings makes log reading very difficult. Thank you very much for your work and for your attention. 👍
References
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Add, change, or delete the background color in Word
Add or change the background color · Go to Design > Page Color. · Choose the color you want under Theme Colors or...
Read more >Solved: No color option in the network printer properties
Click on the Advanced tab. Click on the New Driver button. A new Windows opens with a message saying "Welcome to the Add...
Read more >Background color for Tk in Python - Stack Overflow
Themed ones tend not to; the background color of a widget is a property of the style/theme there. – Donal Fellows. May 2,...
Read more >Is there a transparent color(no color) in color panel we can use?
... and Office Supplies, but need a "no color" for Technology. ... It will show as black on the palette, but when you...
Read more >Ansible Configuration Settings
You can specify a relative path for many configuration options. ... forces color mode even when running without a TTY or the “nocolor”...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ah, thank you for explaining! Yeah, I’d be cautious about doing a string search for
Error:
as well. Unfortunately there is no better solution at the moment while still using the CDKTF CLI. That said, you could certainly invoke the Terraform CLI directly in thecdktf.out/stacks/<your-stack>
directory and pass the-json
option toterraform apply
. Depending on the system you are trying to build, this might be worth the effort.Regarding the color: While
FORCE_COLOR
disables all the color the CDKTF CLI uses, it still invokes the Terraform CLI under the hood (and redirects its output). Until we support a proper-no-color
option you should be able to disable the colored output for the Terraform CLI by additionally settingTF_CLI_ARGS="-no-color"
.The output given by cdk is really verbose. It is good for a human to go through it and understand what is going on. It is not so good if you want to output it to a existing logging structure. I would like to either receive a confirmation of success or the error that was generated, without the terraform formatted string/redundant information.
A quick and dirty solution would be to parse the output and search for the
Error:
string and get the content until the next new line, but everything in me is screaming against it. Maybe there is already an option to get this information without having to resort to this terrible solution. 😁About the
FORCE_COLOR=0
: Im still getting color. 😭 Less than before, but still some color:From pod’s log:
From console with
FORCE_COLOR=0
From console with
FORCE_COLOR=1