Class: SelectRailsLog::Filter::RequestIdFilter

Inherits:
BaseFilter show all
Defined in:
lib/select_rails_log/filter/request_id_filter.rb

Constant Summary

Constants included from Constants

Constants::ACTION, Constants::CLIENT, Constants::COMPLETED, Constants::CONTROLLER, Constants::DEBUG, Constants::DEFAULT_OUTPUT, Constants::DURATION, Constants::HTTP_METHOD, Constants::HTTP_STATUS, Constants::ID, Constants::INTERVAL, Constants::LOGS, Constants::MESSAGE, Constants::PARAMETERS, Constants::PATH, Constants::PERFORMANCE, Constants::PERFORMANCE_ACTIVE_RECORD, Constants::PERFORMANCE_ALLOCATIONS, Constants::PERFORMANCE_VIEWS, Constants::PID, Constants::RAW_LOGS, Constants::REQUEST_ID, Constants::SEVERITY, Constants::STARTED, Constants::TIME

Instance Attribute Summary

Attributes inherited from Extension

#options

Instance Method Summary collapse

Methods inherited from BaseFilter

filter_type, #line_filter?, #request_filter?

Methods inherited from Extension

option_initializers

Constructor Details

#initializeRequestIdFilter

Returns a new instance of RequestIdFilter.



12
13
14
15
# File 'lib/select_rails_log/filter/request_id_filter.rb', line 12

def initialize(...)
  super
  @request_ids = options[:request_ids].dup
end

Instance Method Details

#run(data) ⇒ Object

Raises:

  • (StopIteration)


21
22
23
24
25
# File 'lib/select_rails_log/filter/request_id_filter.rb', line 21

def run(data)
  raise StopIteration if @request_ids.empty?

  !!@request_ids.delete(data[REQUEST_ID])
end

#runnable?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/select_rails_log/filter/request_id_filter.rb', line 17

def runnable?
  !!@request_ids&.any?
end