module Datadog::Patcher

Deprecated: This module should no longer be included. It's only being kept around for backwards compatibility concerns regarding customer usage.

Constants

DO_ONCE_USAGE_WARN_ONLY_ONCE
INCLUDED_WARN_ONLY_ONCE

Public Class Methods

included(base) click to toggle source
# File lib/ddtrace/patcher.rb, line 11
def self.included(base)
  INCLUDED_WARN_ONLY_ONCE.run do
    Datadog.logger.warn(
      'Including Datadog::Patcher is deprecated. ' \
      'For the #do_once behavior, use Datadog::Utils::OnlyOnce instead. ' \
      'For the #without_warnings behavior, use Datadog::Patcher.without_warnings { ... } as a module function.'
    )
  end

  base.extend(CommonMethods)
  base.include(CommonMethods)
end

Public Instance Methods

done?(key, options = {}) click to toggle source
# File lib/ddtrace/patcher.rb, line 55
def done?(key, options = {})
  DO_ONCE_USAGE_WARN_ONLY_ONCE.run do
    Datadog.logger.warn('Datadog::Patcher#done? is deprecated. Use Datadog::Utils::OnlyOnce instead.')
  end

  return false unless instance_variable_defined?(:@done_once)

  !@done_once.nil? && @done_once.key?(key) && @done_once[key].key?(options[:for])
end