Sha256: ce5c94b789d6293360acaed472ea016a370399a7d72b81f120c624059def7476

Contents?: true

Size: 896 Bytes

Versions: 2

Compression:

Stored size: 896 Bytes

Contents

# encoding: utf-8
# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
# frozen_string_literal: true

require_relative 'active_support_logger/instrumentation'
require_relative 'active_support_logger/chain'
require_relative 'active_support_logger/prepend'

DependencyDetection.defer do
  named :active_support_logger

  depends_on { defined?(::ActiveSupport::Logger) }

  executes do
    ::NewRelic::Agent.logger.info('Installing ActiveSupport::Logger instrumentation')

    if use_prepend?
      # the only method currently instrumented is a class method
      prepend_instrument ::ActiveSupport::Logger.singleton_class, NewRelic::Agent::Instrumentation::ActiveSupportLogger::Prepend
    else
      chain_instrument NewRelic::Agent::Instrumentation::ActiveSupportLogger::Chain
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
newrelic_rpm-8.10.1 lib/new_relic/agent/instrumentation/active_support_logger.rb
newrelic_rpm-8.10.0 lib/new_relic/agent/instrumentation/active_support_logger.rb