summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordanielsdeleo <dan@getchef.com>2015-05-13 14:31:27 -0700
committerThom May <thom@chef.io>2015-05-21 13:47:26 +0100
commit458e04c42e31526d524d3097028f70dc72c9c20d (patch)
tree2f92909084e540f99305cdeed314a5bbd0f89708
parent2ab69e419acd19b614bdf85714c18293f588021c (diff)
downloadchef-458e04c42e31526d524d3097028f70dc72c9c20d.tar.gz
Configure logger before loading config
-rw-r--r--lib/chef/config.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/chef/config.rb b/lib/chef/config.rb
index 4c72f25af3..28c415aec8 100644
--- a/lib/chef/config.rb
+++ b/lib/chef/config.rb
@@ -19,6 +19,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+require 'chef/log'
+require 'chef-config/logger'
+
+# DI our logger into ChefConfig before we load the config. Some defaults are
+# auto-detected, and this emits log messages on some systems, all of which will
+# occur at require-time. So we need to set the logger first.
+ChefConfig.logger = Chef::Log
+
require 'chef-config/config'
class Chef