tobami / littlechef

Cook with Chef without a Chef Server
Apache License 2.0
472 stars 71 forks source link

Add option for colorless output #232

Closed thekorn closed 9 years ago

thekorn commented 9 years ago

when running fix in an environment where terminal colors are not supported, like jenkins, the control chars cannot be interpreted and the resulting output is disordered, for example

[2014-12-09T07:53:19+00:00] WARN: Current  execute[apt-get update]: /tmp/chef-solo/cookbooks/apt/providers/repository.rb:110:in `block in class_from_file'
[2014-12-09T07:53:20+00:00] INFO: Chef Run complete in 87.35464718 seconds
[2014-12-09T07:53:20+00:00] INFO: Running report handlers
[2014-12-09T07:54:09+00:00] INFO: Report handlers complete
Warning: Permanently added 'a.edelight.net,x.y.z.a' (RSA) to the list of known hosts.

SUCCESS: Node correctly configured

== Configuring a.edelight.net ==
Synchronizing nodes, environments, roles, cookbooks and data bags...

Cooking...
sudo password:
[2014-12-09T07:54:21+00:00] INFO: *** Chef 10.34.6 ***
[2014-12-09T07:54:24+00:00] INFO: Setting the run_list to ["role[env_production]", "role[munin]"] from JSON
[2014-12-09T07:54:24+00:00] INFO: Run List is [role[env_production], role[munin]]

It is esp. worse to mention that in this case the "Warning: Permanently added ..."-line appears not were it should, if color was supported it would appear two lines later

thekorn commented 9 years ago

implemented in https://github.com/tobami/littlechef/pull/233