Sha256: edd308c35b40c71afcc31e964589e4596a199f895cbb0a4ecd044a7963e3bdfc

Contents?: true

Size: 679 Bytes

Versions: 11

Compression:

Stored size: 679 Bytes

Contents

require "logstash/outputs/base"

class LogStash::Outputs::Internal < LogStash::Outputs::Base
  def initialize(url, config={}, &block)
    super
    @callback = block
  end

  def register
    @logger.info("Registering output #{@url}")
  end # def register

  def receive(event)
    if !@callback
      @logger.error("No callback for output #{@url}, cannot receive")
      return
    end
    @callback.call(event)
  end # def event

  # Set the callback by passing a block of code
  def callback(&block)
    @callback = block
  end

  # Set the callback by passing a proc object
  def callback=(proc_block)
    @callback = proc_block
  end
end # class LogStash::Outputs::Internal

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
logstash-lite-0.2.20101222161646 lib/logstash/outputs/internal.rb
logstash-lite-0.2.20101208111718 lib/logstash/outputs/internal.rb
logstash-lite-0.2.20101207114354 lib/logstash/outputs/internal.rb
logstash-lite-0.2.20101201111523 lib/logstash/outputs/internal.rb
logstash-lite-0.2.20101129210156 lib/logstash/outputs/internal.rb
logstash-lite-0.2.20101129205551 lib/logstash/outputs/internal.rb
logstash-lite-0.2.20101129155412 lib/logstash/outputs/internal.rb
logstash-lite-0.2.20101124030048 lib/logstash/outputs/internal.rb
logstash-lite-0.2.20101124004656 lib/logstash/outputs/internal.rb
logstash-lite-0.2.20101123134625 lib/logstash/outputs/internal.rb
logstash-lite-0.2.20101123133737 lib/logstash/outputs/internal.rb