Method: Chef.deprecated
- Defined in:
- lib/chef/chef_class.rb
.deprecated(type, message, location = nil) ⇒ void
This method returns an undefined value.
Emit a deprecation message.
216 217 218 219 220 221 222 223 224 225 226 |
# File 'lib/chef/chef_class.rb', line 216 def deprecated(type, , location = nil) location ||= Chef::Log.caller_location deprecation = Chef::Deprecated.create(type, , 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 run_context.events.deprecation(deprecation, location) elsif !deprecation.silenced? Chef::Log.deprecation(deprecation.to_s) end end |