opscode/chef — pull request #1212 by benesch (2014-01-12 08:37:13+00:00)
Title: [CHEF-4725] Ensure IO.sync is set on default log stream

With the switch to setting "default" config values in chef/config.rb
(9c40ec9c), an unconfigured "log_location" setting defaults to
STDOUT, but fails to set STDOUT.sync = true. This results in massive
output buffering under some circumstances, like provisioning through
Vagrant.

Previously, the "log_location" setter method would ensure that
setting "log_location" would set sync = true on the stream. But
falling back to the default value does not trigger this setter,
leaving sync unset.

This commit ensures IO.sync is set when the logger is initialized and
not when the setting is configured. This should be more robust against
future configuration reworking.

[CHEF-4725](https://tickets.opscode.com/browse/CHEF-4725)