Sha256: 0e77e10b1249e393f0041e83b0c03504f2c6f0ab588e8b8885b8dc3a7aee801d

Contents?: true

Size: 913 Bytes

Versions: 12

Compression:

Stored size: 913 Bytes

Contents

module Logtail
  module Integrations
    module ActionController
      # Responsible for removing the default ActionController::LogSubscriber and installing
      # the LogtailLogSubscriber
      #
      # @private
      class LogSubscriber < Integrator
        def initialize
          require "action_controller/log_subscriber"
          require "logtail-rails/action_controller/log_subscriber/logtail_log_subscriber"
        rescue LoadError => e
          raise RequirementNotMetError.new(e.message)
        end

        def integrate!
          return true if Logtail::Integrations::Rails::ActiveSupportLogSubscriber.subscribed?(:action_controller, LogtailLogSubscriber)

          Logtail::Integrations::Rails::ActiveSupportLogSubscriber.unsubscribe!(:action_controller, ::ActionController::LogSubscriber)
          LogtailLogSubscriber.attach_to(:action_controller)
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
logtail-rails-0.2.3 lib/logtail-rails/action_controller/log_subscriber.rb
logtail-rails-0.2.2 lib/logtail-rails/action_controller/log_subscriber.rb
logtail-rails-0.2.1 lib/logtail-rails/action_controller/log_subscriber.rb
logtail-rails-0.1.8 lib/logtail-rails/action_controller/log_subscriber.rb
logtail-rails-0.1.7 lib/logtail-rails/action_controller/log_subscriber.rb
logtail-rails-0.1.6 lib/logtail-rails/action_controller/log_subscriber.rb
logtail-rails-0.1.5 lib/logtail-rails/action_controller/log_subscriber.rb
logtail-rails-0.1.4 lib/logtail-rails/action_controller/log_subscriber.rb
logtail-rails-0.1.3 lib/logtail-rails/action_controller/log_subscriber.rb
logtail-rails-0.1.2 lib/logtail-rails/action_controller/log_subscriber.rb
logtail-rails-0.1.1 lib/logtail-rails/action_controller/log_subscriber.rb
logtail-rails-0.1.0 lib/logtail-rails/action_controller/log_subscriber.rb