summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2021-08-24 15:32:08 -0700
committerGitHub <noreply@github.com>2021-08-24 15:32:08 -0700
commitdb3871fed9c6b4e6835f6c3ec89f5bab2e294015 (patch)
treefe9b10ca7233607ee04cac2ccd9c9b402dd2c875
parenta66befe59c2a15c2be31573dcc7b3de76adc4d4d (diff)
parentfe109acb258d0e45d83f8788a4f2f0384dcfde05 (diff)
downloadchef-db3871fed9c6b4e6835f6c3ec89f5bab2e294015.tar.gz
Merge pull request #11946 from chef/logging
Improve phase logging
-rw-r--r--lib/chef/formatters/doc.rb19
-rw-r--r--lib/chef/formatters/minimal.rb7
-rw-r--r--spec/unit/formatters/doc_spec.rb2
3 files changed, 15 insertions, 13 deletions
diff --git a/lib/chef/formatters/doc.rb b/lib/chef/formatters/doc.rb
index 2a3f9faef3..c573bb0570 100644
--- a/lib/chef/formatters/doc.rb
+++ b/lib/chef/formatters/doc.rb
@@ -41,10 +41,11 @@ class Chef
end
def run_start(version, run_status)
- puts_line "Starting #{ChefUtils::Dist::Infra::PRODUCT}, version #{version}"
+ puts_line "#{ChefUtils::Dist::Infra::PRODUCT}, version #{version}"
puts_line "Patents: #{ChefUtils::Dist::Org::PATENTS}"
- puts_line "Targeting node: #{Chef::Config.target_mode.host}" if Chef::Config.target_mode?
puts_line "OpenSSL FIPS 140 mode enabled" if Chef::Config[:fips]
+ puts_line "Starting Infra Phase"
+ puts_line "Targeting node: #{Chef::Config.target_mode.host}" if Chef::Config.target_mode?
end
def total_resources
@@ -119,12 +120,12 @@ class Chef
def node_load_completed(node, expanded_run_list, config); end
def policyfile_loaded(policy)
- puts_line "Using policy '#{policy["name"]}' at revision '#{policy["revision_id"]}'"
+ puts_line "Using Policyfile '#{policy["name"]}' at revision '#{policy["revision_id"]}'"
end
# Called before the cookbook collection is fetched from the server.
def cookbook_resolution_start(expanded_run_list)
- puts_line "resolving cookbooks for run list: #{expanded_run_list.inspect}"
+ puts_line "Resolving cookbooks for run list: #{expanded_run_list.inspect}"
end
# Called when there is an error getting the cookbook collection from the
@@ -149,7 +150,7 @@ class Chef
# Called before cookbook sync starts
def cookbook_sync_start(cookbook_count)
- puts_line "Synchronizing Cookbooks:"
+ puts_line "Synchronizing cookbooks:"
indent
end
@@ -168,7 +169,7 @@ class Chef
# Called when starting to collect gems from the cookbooks
def cookbook_gem_start(gems)
- puts_line "Installing Cookbook Gems:"
+ puts_line "Installing cookbook gem dependencies:"
indent
end
@@ -194,7 +195,7 @@ class Chef
# Called when cookbook loading starts.
def library_load_start(file_count)
- puts_line "Compiling Cookbooks..."
+ puts_line "Compiling cookbooks..."
end
# Called after a file in a cookbook is loaded.
@@ -280,7 +281,7 @@ class Chef
end
def resource_bypassed(resource, action, provider)
- puts " (Skipped: whyrun not supported by provider #{provider.class.name})", stream: resource
+ puts " (Skipped: Why-Run not supported by provider #{provider.class.name})", stream: resource
unindent
end
@@ -317,7 +318,7 @@ class Chef
# Called when resource current state load is skipped due to the provider
# not supporting whyrun mode.
def resource_current_state_load_bypassed(resource, action, current_resource)
- puts_line("* Whyrun not supported for #{resource}, bypassing load.", :yellow)
+ puts_line("* Why-Run not supported for #{resource}, bypassing load.", :yellow)
end
def stream_output(stream, output, options = {})
diff --git a/lib/chef/formatters/minimal.rb b/lib/chef/formatters/minimal.rb
index 6a067c4f86..b2d0d7f264 100644
--- a/lib/chef/formatters/minimal.rb
+++ b/lib/chef/formatters/minimal.rb
@@ -28,10 +28,11 @@ class Chef
# Called at the very start of a Chef Run
def run_start(version, run_status)
- puts_line "Starting #{ChefUtils::Dist::Infra::PRODUCT}, version #{version}"
+ puts_line "#{ChefUtils::Dist::Infra::PRODUCT}, version #{version}"
puts_line "Patents: #{ChefUtils::Dist::Org::PATENTS}"
- puts_line "Targeting node: #{Chef::Config.target_mode.host}" if Chef::Config.target_mode?
puts_line "OpenSSL FIPS 140 mode enabled" if Chef::Config[:fips]
+ puts_line "Starting Infra Phase"
+ puts_line "Targeting node: #{Chef::Config.target_mode.host}" if Chef::Config.target_mode?
end
# Called at the end of the Chef run.
@@ -71,7 +72,7 @@ class Chef
# Called before the cookbook collection is fetched from the server.
def cookbook_resolution_start(expanded_run_list)
- puts "resolving cookbooks for run list: #{expanded_run_list.inspect}"
+ puts "Resolving cookbooks for run list: #{expanded_run_list.inspect}"
end
# Called when there is an error getting the cookbook collection from the
diff --git a/spec/unit/formatters/doc_spec.rb b/spec/unit/formatters/doc_spec.rb
index 73e756464b..4947058a17 100644
--- a/spec/unit/formatters/doc_spec.rb
+++ b/spec/unit/formatters/doc_spec.rb
@@ -40,7 +40,7 @@ describe Chef::Formatters::Base do
}
formatter.policyfile_loaded(minimal_policyfile)
- expect(out.string).to include("Using policy 'jenkins' at revision '613f803bdd035d574df7fa6da525b38df45a74ca82b38b79655efed8a189e073'")
+ expect(out.string).to include("Using Policyfile 'jenkins' at revision '613f803bdd035d574df7fa6da525b38df45a74ca82b38b79655efed8a189e073'")
end
it "prints cookbook name and version" do