Sha256: c4bcf8e8114bc4d4a279be1523da496c2f43d57b6a0b9a8c176214ecd816fec6

Contents?: true

Size: 1.28 KB

Versions: 10

Compression:

Stored size: 1.28 KB

Contents

require 'logger'

module Sqreen
  module Ecosystem
    # Configured by the ecosystem client
    module DispatchTable
      class << self
        # data consumption
        # argument: +Sqreen::Kit::Signals::Signal+
        # see +Sqreen::EcosystemIntegration::SignalConsumption#consume_signal+
        attr_accessor :consume_signal

        # argument: block taking a Rack::Request
        # see +Sqreen::EcosystemIntegration::RequestLifecycleTracking#add_start_observer+
        attr_accessor :add_request_start_listener

        attr_accessor :fetch_logger

        # argument: callback taking:
        # * the method to instrument
        # * A Hash{Symbol=>Proc} with the advice. The proc takes the
        # arguments and the ball, so these details of the instrumentation
        # implementation leak through the abstraction
        # see +Sqreen::EcosystemIntegration::InstrumentationService+
        attr_accessor :instrument

        def reset
          instance_variables.each do |ia|
            instance_variable_set(ia, nil)
          end

          # set default logger
          logger = ::Logger.new(STDERR)
          logger.level = ::Logger::WARN
          logger.progname = 'sqreen-ecosystem'
          self.fetch_logger = proc { logger }
        end
      end

      reset
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
sqreen-1.22.0-java lib/sqreen/ecosystem/dispatch_table.rb
sqreen-1.22.0 lib/sqreen/ecosystem/dispatch_table.rb
sqreen-1.21.1-java lib/sqreen/ecosystem/dispatch_table.rb
sqreen-1.21.1 lib/sqreen/ecosystem/dispatch_table.rb
sqreen-1.21.0-java lib/sqreen/ecosystem/dispatch_table.rb
sqreen-1.21.0 lib/sqreen/ecosystem/dispatch_table.rb
sqreen-1.21.0.beta3-java lib/sqreen/ecosystem/dispatch_table.rb
sqreen-1.21.0.beta3 lib/sqreen/ecosystem/dispatch_table.rb
sqreen-1.21.0.beta2 lib/sqreen/ecosystem/dispatch_table.rb
sqreen-1.21.0.beta1 lib/sqreen/ecosystem/dispatch_table.rb