class LogStash::Codecs::RubyDebug

The rubydebug codec will output your Logstash event data using the Ruby Amazing Print library.

Constants

AMAZING_OPTIONS

AMAZING_OPTIONS = {:color => {:logstash_timestamp => :green}}

Public Instance Methods

decode(data) click to toggle source
# File lib/logstash/codecs/rubydebug.rb, line 28
def decode(data)
  raise "Not implemented"
end
encode(event) click to toggle source
# File lib/logstash/codecs/rubydebug.rb, line 33
def encode(event)
  @encoder.call(event)
end
encode_default(event) click to toggle source
# File lib/logstash/codecs/rubydebug.rb, line 37
def encode_default(event)
  @on_event.call(event, event.to_hash.ai + NL)
end
encode_with_metadata(event) click to toggle source
# File lib/logstash/codecs/rubydebug.rb, line 41
def encode_with_metadata(event)
  @on_event.call(event, event.to_hash_with_metadata.ai + NL)
end
register() click to toggle source
# File lib/logstash/codecs/rubydebug.rb, line 16
def register
  require "amazing_print"
  AmazingPrint.defaults = AMAZING_OPTIONS

  if @metadata
    @encoder = method(:encode_with_metadata)
  else
    @encoder = method(:encode_default)
  end
end