diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2015-02-09 14:47:48 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2015-02-09 14:47:48 -0800 |
commit | 11140c2cbd6f675c1bc0c3f5697f23d6404886ba (patch) | |
tree | d54623e143871639b72d75977adaabf0635a86a4 /lib/chef/log.rb | |
parent | 878ecf09a8945235637e3f761626f1e3c9e86ca1 (diff) | |
download | chef-11140c2cbd6f675c1bc0c3f5697f23d6404886ba.tar.gz |
Add Chef::Log.deprecation and associated wiring
Diffstat (limited to 'lib/chef/log.rb')
-rw-r--r-- | lib/chef/log.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/chef/log.rb b/lib/chef/log.rb index 131d706a5e..56c0ef022c 100644 --- a/lib/chef/log.rb +++ b/lib/chef/log.rb @@ -19,6 +19,7 @@ require 'logger' require 'chef/monologger' +require 'chef/exceptions' require 'mixlib/log' class Chef @@ -34,6 +35,14 @@ class Chef end end + def self.deprecation(msg=nil, &block) + if Chef::Config[:treat_deprecation_warnings_as_errors] + error(msg, *block) + raise Chef::Exceptions::DeprecatedFeatureError + else + warn(msg, *block) + end + end + end end - |