summaryrefslogtreecommitdiff
path: root/lib/chef/knife.rb
diff options
context:
space:
mode:
authorThom May <thom@chef.io>2018-04-11 13:27:05 +0100
committerThom May <thom@chef.io>2018-04-11 13:27:05 +0100
commit59f51b64894318bbd7d682efb38b0cb985bbefea (patch)
treea8dd514d6915d5ede389d3c3bcfa80093f2ae83e /lib/chef/knife.rb
parent76fa86f06fc4b4ed2c4ba165c64b28538c6d637c (diff)
downloadchef-59f51b64894318bbd7d682efb38b0cb985bbefea.tar.gz
Fix up knife loggingtm/investigate_logging
ensure that trace level is selectable if necessary via -VVV Pass the correct object to net/ssh Signed-off-by: Thom May <thom@chef.io>
Diffstat (limited to 'lib/chef/knife.rb')
-rw-r--r--lib/chef/knife.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/chef/knife.rb b/lib/chef/knife.rb
index 4e975c2b27..1e436f0fe6 100644
--- a/lib/chef/knife.rb
+++ b/lib/chef/knife.rb
@@ -370,11 +370,13 @@ class Chef
Chef::Config[:log_level] = :warn
when 1
Chef::Config[:log_level] = :info
- else
+ when 2
Chef::Config[:log_level] = :debug
+ else
+ Chef::Config[:log_level] = :trace
end
- Chef::Config[:log_level] = :debug if ENV["KNIFE_DEBUG"]
+ Chef::Config[:log_level] = :trace if ENV["KNIFE_DEBUG"]
Chef::Config[:node_name] = config[:node_name] if config[:node_name]
Chef::Config[:client_key] = config[:client_key] if config[:client_key]
@@ -467,7 +469,7 @@ class Chef
when NameError, NoMethodError
ui.error "knife encountered an unexpected error"
ui.info "This may be a bug in the '#{self.class.common_name}' knife command or plugin"
- ui.info "Please collect the output of this command with the `-VV` option before filing a bug report."
+ ui.info "Please collect the output of this command with the `-VVV` option before filing a bug report."
ui.info "Exception: #{e.class.name}: #{e.message}"
when Chef::Exceptions::PrivateKeyMissing
ui.error "Your private key could not be loaded from #{api_key}"