Method: Puppet::Util::Logging#deprecation_warning

Defined in:
lib/puppet/util/logging.rb

#deprecation_warning(message, key = nil) ⇒ Object

Logs a warning indicating that the Ruby code path is deprecated. Note that this method keeps track of the offending lines of code that triggered the deprecation warning, and will only log a warning once per offending line of code. It will also stop logging deprecation warnings altogether after 100 unique deprecation warnings have been logged. Finally, if Puppet includes ‘deprecations’, it will squelch all warning calls made via this method.

Parameters:

  • message (String)

    The message to log (logs via warning)

  • key (String) (defaults to: nil)

    Optional key to mark the message as unique. If not passed in, the originating call line will be used instead.



143
144
145
# File 'lib/puppet/util/logging.rb', line 143

def deprecation_warning(message, key = nil)
  issue_deprecation_warning(message, key, nil, nil, true)
end