threefoldtech / tfgrid-sdk-go

Apache License 2.0
2 stars 4 forks source link

Add flag to disable output styling #1211

Open scottyeager opened 2 months ago

scottyeager commented 2 months ago

Currently all info logged by tfcmd (I believe tfrobot too) gets styled with colors and bold text using terminal escape sequences. This is not ideal when capturing and parsing this output.

Even the json returned from get commands is wrapped in escape sequences:

$ tfcmd get vm myctest &> output
$ cat -v output

...
    "ContractID": 668773,
    "IPrange": "10.20.2.0/24"
}^[[0m

I'd suspect that the logging library we use has an option to disable the styles. If we can just expose that to the user as a cli flag, that would be a quick fix to improve the situation.