- Enhance testability

This commit is contained in:
Jordan Sissel 2010-11-24 02:14:17 -08:00
parent 2a1bd53121
commit 99791282b4
2 changed files with 9 additions and 1 deletions

View file

@ -4,7 +4,7 @@ require "uri"
# General event type. Will expand this in the future.
module LogStash; class Event
def initialize(data)
def initialize(data=Hash.new)
@cancelled = false
@data = {
"@source" => "unknown",

View file

@ -22,6 +22,14 @@ class LogStash::Filters::Date < LogStash::Filters::Base
@types = Hash.new { |h,k| h[k] = [] }
end # def initialize
def add_config(type, typeconfig)
if @config.include?(type)
@config[type].merge!(typeconfig)
else
@config[type] = typeconfig
end
end
def register
@config.each do |type, typeconfig|
@logger.debug "Setting type #{type.inspect} to the config #{typeconfig.inspect}"