summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2017-01-20 07:46:38 -0800
committerTim Smith <tsmith@chef.io>2017-01-20 07:46:38 -0800
commit5653b0571b9415dcd8789af61f7dc6120bc19b75 (patch)
tree212d507f4a1feda9f46596fed0b7607700358f14
parent60c7fd2a22cc95a8e52e9c0579ed7d49c531635a (diff)
parent33272039bea33e62f8ae25eda047208d4772cf3c (diff)
downloadohai-5653b0571b9415dcd8789af61f7dc6120bc19b75.tar.gz
Merge branch 'tm/fix_app_logging'
-rw-r--r--lib/ohai/application.rb2
-rw-r--r--lib/ohai/system.rb4
-rw-r--r--spec/unit/system_spec.rb1
3 files changed, 2 insertions, 5 deletions
diff --git a/lib/ohai/application.rb b/lib/ohai/application.rb
index 0b0327e7..9f1c400f 100644
--- a/lib/ohai/application.rb
+++ b/lib/ohai/application.rb
@@ -83,6 +83,8 @@ class Ohai::Application
@attributes = nil if @attributes.empty?
load_workstation_config
+
+ Ohai::Log.init(Ohai.config[:log_location])
end
def run_application
diff --git a/lib/ohai/system.rb b/lib/ohai/system.rb
index c55383ca..01ee6463 100644
--- a/lib/ohai/system.rb
+++ b/lib/ohai/system.rb
@@ -220,10 +220,6 @@ module Ohai
end
def configure_logging
- return if Ohai::Log.configured?
-
- Ohai::Log.init(Ohai.config[:log_location])
-
if Ohai.config[:log_level] == :auto
Ohai::Log.level = :info
else
diff --git a/spec/unit/system_spec.rb b/spec/unit/system_spec.rb
index 0144ff61..11bec51c 100644
--- a/spec/unit/system_spec.rb
+++ b/spec/unit/system_spec.rb
@@ -101,7 +101,6 @@ describe "Ohai::System" do
it "configures logging" do
log_level = :debug
Ohai.config[:log_level] = log_level
- expect(Ohai::Log).to receive(:init).with(Ohai.config[:log_location])
expect(Ohai::Log).to receive(:level=).with(log_level)
Ohai::System.new
end