Sha256: 5ee179359b21f70f80ae95a60309e81c6a5c9e9e1c0dd6e4805ea6c36dd1bc82

Contents?: true

Size: 767 Bytes

Versions: 30

Compression:

Stored size: 767 Bytes

Contents

module Timber
  module Probes
    # Responsible for automatically tracking controller call and http response events
    # for applications that use `ActionController`.
    class ActionControllerLogSubscriber < Probe
      def initialize
        require "action_controller/log_subscriber"
        require "timber/probes/action_controller_log_subscriber/log_subscriber"
      rescue LoadError => e
        raise RequirementNotMetError.new(e.message)
      end

      def insert!
        return true if Util::ActiveSupportLogSubscriber.subscribed?(:action_controller, LogSubscriber)
        Util::ActiveSupportLogSubscriber.unsubscribe(:action_controller, ::ActionController::LogSubscriber)
        LogSubscriber.attach_to(:action_controller)
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 2 rubygems

Version Path
timber-1.0.8 lib/timber/probes/action_controller_log_subscriber.rb
timber-1.0.7 lib/timber/probes/action_controller_log_subscriber.rb
timber-1.0.6 lib/timber/probes/action_controller_log_subscriber.rb
timber-1.0.5 lib/timber/probes/action_controller_log_subscriber.rb
timber-1.0.4 lib/timber/probes/action_controller_log_subscriber.rb
timber-1.0.3 lib/timber/probes/action_controller_log_subscriber.rb
timberio-1.0.3 lib/timber/probes/action_controller_log_subscriber.rb
timberio-1.0.2 lib/timber/probes/action_controller_log_subscriber.rb
timberio-1.0.1 lib/timber/probes/action_controller_log_subscriber.rb
timberio-1.0.0 lib/timber/probes/action_controller_log_subscriber.rb