summaryrefslogtreecommitdiff
path: root/lib/chef/log.rb
diff options
context:
space:
mode:
authorJohn Keiser <john@johnkeiser.com>2015-08-31 14:38:50 -0700
committerJohn Keiser <john@johnkeiser.com>2015-09-01 19:30:43 -0700
commit25dac92eeb1ffa83ec549bfed0b19672c5847d80 (patch)
treef5292bfb261d40f1bbe3bdfa2845de87245f78d4 /lib/chef/log.rb
parentad8fd4d65b48519ac154ad9bf9774322b0c6d902 (diff)
downloadchef-25dac92eeb1ffa83ec549bfed0b19672c5847d80.tar.gz
Pass deprecations through formatter instead of logs
Diffstat (limited to 'lib/chef/log.rb')
-rw-r--r--lib/chef/log.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/chef/log.rb b/lib/chef/log.rb
index 9b27778a40..2cf08324c8 100644
--- a/lib/chef/log.rb
+++ b/lib/chef/log.rb
@@ -37,7 +37,8 @@ class Chef
end
end
- def self.deprecation(msg=nil, &block)
+ def self.deprecation(msg=nil, location=caller(2..2)[0], &block)
+ msg = Array(msg) + [ location ] if location
if Chef::Config[:treat_deprecation_warnings_as_errors]
error(msg, &block)
raise Chef::Exceptions::DeprecatedFeatureError.new(msg)