class Timber::Integrations::ActionController::LogSubscriber

Responsible for removing the default ActionController::LogSubscriber and installing the TimberLogSubscriber

@private

Public Class Methods

new() click to toggle source
# File lib/timber-rails/action_controller/log_subscriber.rb, line 9
def initialize
  require "action_controller/log_subscriber"
  require "timber-rails/action_controller/log_subscriber/timber_log_subscriber"
rescue LoadError => e
  raise RequirementNotMetError.new(e.message)
end

Public Instance Methods

integrate!() click to toggle source
# File lib/timber-rails/action_controller/log_subscriber.rb, line 16
def integrate!
  return true if Timber::Integrations::Rails::ActiveSupportLogSubscriber.subscribed?(:action_controller, TimberLogSubscriber)

  Timber::Integrations::Rails::ActiveSupportLogSubscriber.unsubscribe!(:action_controller, ::ActionController::LogSubscriber)
  TimberLogSubscriber.attach_to(:action_controller)
end