Sha256: 3558090ce999528bd599c79d000356787f5a905d74d6516f9aef55ed30d810f1

Contents?: true

Size: 787 Bytes

Versions: 17

Compression:

Stored size: 787 Bytes

Contents

# frozen_string_literal: true

require_relative './log_subscriber'

module Cased
  module Instrumentation
    module Controller
      extend ActiveSupport::Concern

      module ClassMethods
        def log_process_action(payload)
          messages = super
          count = payload[:cased_events]
          if count
            messages << format('Cased: %<count>d %<suffix>s', count: count, suffix: 'event'.pluralize(count))
          end
          messages
        end
      end

      protected

      def process_action(action, *args)
        Cased::Instrumentation::LogSubscriber.reset_events
        super
      end

      def append_info_to_payload(payload)
        super
        payload[:cased_events] = Cased::Instrumentation::LogSubscriber.events
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
cased-ruby-0.8.0 lib/cased/instrumentation/controller.rb
cased-ruby-0.7.1 lib/cased/instrumentation/controller.rb
cased-ruby-0.7.0 lib/cased/instrumentation/controller.rb
cased-ruby-0.6.1 lib/cased/instrumentation/controller.rb
cased-ruby-0.5.2 lib/cased/instrumentation/controller.rb
cased-ruby-0.5.1 lib/cased/instrumentation/controller.rb
cased-ruby-0.5.0 lib/cased/instrumentation/controller.rb
cased-ruby-0.4.8 lib/cased/instrumentation/controller.rb
cased-ruby-0.4.7 lib/cased/instrumentation/controller.rb
cased-ruby-0.4.6 lib/cased/instrumentation/controller.rb
cased-ruby-0.4.5 lib/cased/instrumentation/controller.rb
cased-ruby-0.4.4 lib/cased/instrumentation/controller.rb
cased-ruby-0.4.3 lib/cased/instrumentation/controller.rb
cased-ruby-0.4.2 lib/cased/instrumentation/controller.rb
cased-ruby-0.4.1 lib/cased/instrumentation/controller.rb
cased-ruby-0.4.0 lib/cased/instrumentation/controller.rb
cased-ruby-0.3.3 lib/cased/instrumentation/controller.rb