summaryrefslogtreecommitdiff
path: root/lib/chef/chef_class.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/chef_class.rb')
-rw-r--r--lib/chef/chef_class.rb12
1 files changed, 1 insertions, 11 deletions
diff --git a/lib/chef/chef_class.rb b/lib/chef/chef_class.rb
index 6a0d09ec96..5ccb8bb92b 100644
--- a/lib/chef/chef_class.rb
+++ b/lib/chef/chef_class.rb
@@ -205,17 +205,7 @@ class Chef
# @api private this will likely be removed in favor of an as-yet unwritten
# `Chef.log`
def log_deprecation(message, location=nil)
- if !location
- # Pick the first caller that is *not* part of the Chef gem, that's the
- # thing the user wrote.
- chef_gem_path = File.expand_path("../..", __FILE__)
- caller(0..10).each do |c|
- if !c.start_with?(chef_gem_path)
- location = c
- break
- end
- end
- end
+ location ||= Chef::Log.caller_location
# `run_context.events` is the primary deprecation target if we're in a
# run. If we are not yet in a run, print to `Chef::Log`.
if run_context && run_context.events