Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix log level selection when running the ohai command #942

Merged
merged 1 commit into from
Jan 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/ohai/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ def configure_ohai
@attributes = nil if @attributes.empty?

load_workstation_config

Ohai::Log.init(Ohai.config[:log_location])
end

def run_application
Expand Down
4 changes: 0 additions & 4 deletions lib/ohai/system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,6 @@ def configure_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
Expand Down
1 change: 0 additions & 1 deletion spec/unit/system_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@
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
Expand Down