Class: Fluent::Compat::Filter

Inherits:
Plugin::Filter
  • Object
show all
Defined in:
lib/fluent/compat/filter.rb

Instance Method Summary collapse

Constructor Details

#initializeFilter

Returns a new instance of Filter.



30
31
32
33
34
35
# File 'lib/fluent/compat/filter.rb', line 30

def initialize
  super
  unless self.class.ancestors.include?(Fluent::Compat::CallSuperMixin)
    self.class.prepend Fluent::Compat::CallSuperMixin
  end
end

Instance Method Details

#before_shutdownObject



59
60
61
# File 'lib/fluent/compat/filter.rb', line 59

def before_shutdown
  super
end

#configure(conf) ⇒ Object



37
38
39
40
41
42
# File 'lib/fluent/compat/filter.rb', line 37

def configure(conf)
  ParserUtils.convert_parser_conf(conf)
  FormatterUtils.convert_formatter_conf(conf)

  super
end

#shutdownObject



63
64
65
# File 'lib/fluent/compat/filter.rb', line 63

def shutdown
  super
end

#startObject

These definitions are to get instance methods of superclass of 3rd party plugins to make it sure to call super



46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/fluent/compat/filter.rb', line 46

def start
  super

  if instance_variable_defined?(:@formatter) && @inject_config
    unless @formatter.class.ancestors.include?(Fluent::Compat::HandleTagAndTimeMixin)
      if @formatter.respond_to?(:owner) && !@formatter.owner
        @formatter.owner = self
        @formatter.singleton_class.prepend FormatterUtils::InjectMixin
      end
    end
  end
end