diff options
author | Thom May <thom@chef.io> | 2018-03-23 13:05:13 +0000 |
---|---|---|
committer | Tim Smith <tsmith@chef.io> | 2018-03-26 10:34:39 -0700 |
commit | 97c1dd6f1cac6d97e85d05039cad8b28596141ba (patch) | |
tree | d8a97c0f7016986a2cc264aa50ae345638ed026c /lib/chef/application | |
parent | 1b81f35e023bcdc87e410c641545e849298de5c3 (diff) | |
download | chef-97c1dd6f1cac6d97e85d05039cad8b28596141ba.tar.gz |
mechanical conversion of most debug log statements to trace
Signed-off-by: Thom May <thom@chef.io>
Diffstat (limited to 'lib/chef/application')
-rw-r--r-- | lib/chef/application/client.rb | 10 | ||||
-rw-r--r-- | lib/chef/application/solo.rb | 12 | ||||
-rw-r--r-- | lib/chef/application/windows_service.rb | 10 |
3 files changed, 16 insertions, 16 deletions
diff --git a/lib/chef/application/client.rb b/lib/chef/application/client.rb index 706ba93ca0..5ee1d1a4ec 100644 --- a/lib/chef/application/client.rb +++ b/lib/chef/application/client.rb @@ -336,10 +336,10 @@ class Chef::Application::Client < Chef::Application Chef::Application.fatal!("chef-client recipe-url can be used only in local-mode") else if Chef::Config[:delete_entire_chef_repo] - Chef::Log.debug "Cleanup path #{Chef::Config.chef_repo_path} before extract recipes into it" + Chef::Log.trace "Cleanup path #{Chef::Config.chef_repo_path} before extract recipes into it" FileUtils.rm_rf(recipes_path, :secure => true) end - Chef::Log.debug "Creating path #{Chef::Config.chef_repo_path} to extract recipes into" + Chef::Log.trace "Creating path #{Chef::Config.chef_repo_path} to extract recipes into" FileUtils.mkdir_p(Chef::Config.chef_repo_path) tarball_path = File.join(Chef::Config.chef_repo_path, "recipes.tgz") fetch_recipe_tarball(Chef::Config[:recipe_url], tarball_path) @@ -467,7 +467,7 @@ class Chef::Application::Client < Chef::Application end def sleep_then_run_chef_client(sleep_sec) - Chef::Log.debug("Sleeping for #{sleep_sec} seconds") + Chef::Log.trace("Sleeping for #{sleep_sec} seconds") # interval_sleep will return early if we received a signal (unless on windows) interval_sleep(sleep_sec) @@ -480,7 +480,7 @@ class Chef::Application::Client < Chef::Application rescue Exception => e if Chef::Config[:interval] Chef::Log.error("#{e.class}: #{e}") - Chef::Log.debug("#{e.class}: #{e}\n#{e.backtrace.join("\n")}") + Chef::Log.trace("#{e.class}: #{e}\n#{e.backtrace.join("\n")}") retry end @@ -533,7 +533,7 @@ class Chef::Application::Client < Chef::Application end def fetch_recipe_tarball(url, path) - Chef::Log.debug("Download recipes tarball from #{url} to #{path}") + Chef::Log.trace("Download recipes tarball from #{url} to #{path}") File.open(path, "wb") do |f| open(url) do |r| f.write(r.read) diff --git a/lib/chef/application/solo.rb b/lib/chef/application/solo.rb index f8502edc38..2294d63c21 100644 --- a/lib/chef/application/solo.rb +++ b/lib/chef/application/solo.rb @@ -242,7 +242,7 @@ class Chef::Application::Solo < Chef::Application ARGV.delete("--ez") # For back compat reasons, we need to ensure that we try and use the cache_path as a repo first - Chef::Log.debug "Current chef_repo_path is #{Chef::Config.chef_repo_path}" + Chef::Log.trace "Current chef_repo_path is #{Chef::Config.chef_repo_path}" if !Chef::Config.has_key?(:cookbook_path) && !Chef::Config.has_key?(:chef_repo_path) Chef::Config.chef_repo_path = Chef::Config.find_chef_repo_path(Chef::Config[:cache_path]) @@ -272,10 +272,10 @@ class Chef::Application::Solo < Chef::Application recipes_path = File.expand_path(File.join(cookbooks_path, "..")) if Chef::Config[:delete_entire_chef_repo] - Chef::Log.debug "Cleanup path #{recipes_path} before extract recipes into it" + Chef::Log.trace "Cleanup path #{recipes_path} before extract recipes into it" FileUtils.rm_rf(recipes_path, :secure => true) end - Chef::Log.debug "Creating path #{recipes_path} to extract recipes into" + Chef::Log.trace "Creating path #{recipes_path} to extract recipes into" FileUtils.mkdir_p(recipes_path) tarball_path = File.join(recipes_path, "recipes.tgz") fetch_recipe_tarball(Chef::Config[:recipe_url], tarball_path) @@ -336,7 +336,7 @@ EOH sleep_sec += rand(Chef::Config[:splay]) if Chef::Config[:splay] sleep_sec += Chef::Config[:interval] if Chef::Config[:interval] if sleep_sec != 0 - Chef::Log.debug("Sleeping for #{sleep_sec} seconds") + Chef::Log.trace("Sleeping for #{sleep_sec} seconds") sleep(sleep_sec) end @@ -349,7 +349,7 @@ EOH rescue Exception => e if Chef::Config[:interval] Chef::Log.error("#{e.class}: #{e}") - Chef::Log.debug("#{e.class}: #{e}\n#{e.backtrace.join("\n")}") + Chef::Log.trace("#{e.class}: #{e}\n#{e.backtrace.join("\n")}") retry else Chef::Application.fatal!("#{e.class}: #{e.message}", e) @@ -359,7 +359,7 @@ EOH end def fetch_recipe_tarball(url, path) - Chef::Log.debug("Download recipes tarball from #{url} to #{path}") + Chef::Log.trace("Download recipes tarball from #{url} to #{path}") File.open(path, "wb") do |f| open(url) do |r| f.write(r.read) diff --git a/lib/chef/application/windows_service.rb b/lib/chef/application/windows_service.rb index fa4b3fd27e..41dcc55d70 100644 --- a/lib/chef/application/windows_service.rb +++ b/lib/chef/application/windows_service.rb @@ -109,9 +109,9 @@ class Chef # Daemon class needs to have all the signal callbacks return # before service_main returns. - Chef::Log.debug("Giving signal callbacks some time to exit...") + Chef::Log.trace("Giving signal callbacks some time to exit...") sleep 1 - Chef::Log.debug("Exiting service...") + Chef::Log.trace("Exiting service...") end ################################################################################ @@ -135,7 +135,7 @@ class Chef run_warning_displayed = true end - Chef::Log.debug("Waiting for chef-client run...") + Chef::Log.trace("Waiting for chef-client run...") sleep 1 end end @@ -200,8 +200,8 @@ class Chef :timeout => Chef::Config[:windows_service][:watchdog_timeout], :logger => Chef::Log ) - Chef::Log.debug "#{result.stdout}" - Chef::Log.debug "#{result.stderr}" + Chef::Log.trace "#{result.stdout}" + Chef::Log.trace "#{result.stderr}" rescue Mixlib::ShellOut::CommandTimeout => e Chef::Log.error "chef-client timed out\n(#{e})" Chef::Log.error(<<-EOF) |