Sha256: 5b52b36f9b9067af8a192e02700d0423e08278ec00b0924ed4ffc9b19685fc4a

Contents?: true

Size: 728 Bytes

Versions: 13

Compression:

Stored size: 728 Bytes

Contents

require 'action_controller/log_subscriber'
ActionController::LogSubscriber

module ActionController
  class LogSubscriber
    # Log as info to show Processing messages in production
    def start_processing(event)
      controller_logger(event).info { "Processing ##{event.payload[:action]}" }
    end

    private

    # Returns the logger for the supplied event.
    # Returns ActionController::Base.logger if no controller is present
    def controller_logger(event)
      if controller = event.payload[:controller]
        begin
          controller.constantize.logger
        rescue NameError
          ActionController::Base.logger
        end
      else
        ActionController::Base.logger
      end
    end

  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
rails_semantic_logger-4.2.0 lib/rails_semantic_logger/extensions/action_controller/log_subscriber_processing.rb
rails_semantic_logger-4.1.3 lib/rails_semantic_logger/extensions/action_controller/log_subscriber_processing.rb
rails_semantic_logger-4.1.2 lib/rails_semantic_logger/extensions/action_controller/log_subscriber_processing.rb
rails_semantic_logger-4.1.1 lib/rails_semantic_logger/extensions/action_controller/log_subscriber_processing.rb
rails_semantic_logger-4.1.0 lib/rails_semantic_logger/extensions/action_controller/log_subscriber_processing.rb
rails_semantic_logger-4.0.1 lib/rails_semantic_logger/extensions/action_controller/log_subscriber_processing.rb
rails_semantic_logger-4.0.0 lib/rails_semantic_logger/extensions/action_controller/log_subscriber_processing.rb
rails_semantic_logger-4.0.0.rc1 lib/rails_semantic_logger/extensions/action_controller/log_subscriber_processing.rb
rails_semantic_logger-4.0.0.beta2 lib/rails_semantic_logger/extensions/action_controller/log_subscriber_processing.rb
rails_semantic_logger-4.0.0.beta1 lib/rails_semantic_logger/extensions/action_controller/log_subscriber_processing.rb
rails_semantic_logger-3.4.1 lib/rails_semantic_logger/extensions/action_controller/log_subscriber_processing.rb
rails_semantic_logger-3.4.0 lib/rails_semantic_logger/extensions/action_controller/log_subscriber_processing.rb
rails_semantic_logger-3.3.1 lib/rails_semantic_logger/extensions/action_controller/log_subscriber_processing.rb