chef / chef-apply

The ad-hoc execution tool for the Chef ecosystem.
https://www.chef.sh/
Apache License 2.0
14 stars 14 forks source link

[SHACK-312] fix writing log output to a location specified #25

Closed karthanistyr closed 6 years ago

karthanistyr commented 6 years ago

Signed-off-by: Antoine Mazeas antoine@karthanis.net Redone PR because checkouts weren't signed off

Description

Some code shuffling to enable honouring the log.level config setting throughout a chef-apply (chef-run) run.

Issues Resolved

Fixes #23.

Check List

robbkidd commented 6 years ago

@karthanistyr This is definitely a fix! But it appears to be more about getting the logger to honor and actually send log output to the location set in the config. It presented as a log level issue because the vast majority of the log output is at DEBUG (as you mention in #28 and offer a change to in #29), so it was only at debug level that a user would have output to see. Fixing location so that the instance variable for it is assigned after the reassignment to $stdout or a File open for writing has the self.location method returning the correct value ($stdout or the File, not a string that's a path to a file).

I'm going to update the title of this PR to describe the fix more accurately.

karthanistyr commented 6 years ago

@robbkidd Sure, I added a change to the spec to match the new behaviour. HTH.

robbkidd commented 6 years ago

Thanks for finding and fixing this, @karthanistyr!

tenor-256364920