diff options
author | Thom May <thom@chef.io> | 2016-10-14 16:46:51 +0100 |
---|---|---|
committer | Thom May <thom@chef.io> | 2016-11-16 16:28:15 +0000 |
commit | 64b8b0efd90e59ad609ba30fe4bc7ff19e70e940 (patch) | |
tree | 779c33247a0617eed1db6b6a662635a0f91d37d3 /lib/chef/formatters/base.rb | |
parent | bedcbd5f52448d24fdd7ab26ab79185c011beee3 (diff) | |
download | chef-64b8b0efd90e59ad609ba30fe4bc7ff19e70e940.tar.gz |
Structure deprecations with additional metadatatm/deprecation_with_url
This adds URLs to each class of deprecation, and correctly prints and
formats them for maximum user efficiency. We also provide the URL to the
data collector for Visibility to ingest.
Signed-off-by: Thom May <thom@chef.io>
Diffstat (limited to 'lib/chef/formatters/base.rb')
-rw-r--r-- | lib/chef/formatters/base.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/chef/formatters/base.rb b/lib/chef/formatters/base.rb index 536bf72e02..2fbe00862c 100644 --- a/lib/chef/formatters/base.rb +++ b/lib/chef/formatters/base.rb @@ -213,7 +213,17 @@ class Chef end def deprecation(message, location = caller(2..2)[0]) - Chef::Log.deprecation("#{message} at #{location}") + out = if is_structured_deprecation?(message) + message.inspect + else + "#{message} at #{location}" + end + + Chef::Log.deprecation(out) + end + + def is_structured_deprecation?(deprecation) + deprecation.kind_of?(Chef::Deprecated::Base) end def is_formatter? |