Skip to content

Commit

Permalink
Merge pull request #1005 from fluent/fix-call-filter_record-from-comp…
Browse files Browse the repository at this point in the history
…at-v14

Fix to call #format_stream of plugin themselves when RecordFilter mixin included
  • Loading branch information
tagomoris committed May 30, 2016
2 parents fa3bc38 + 0319614 commit 9cd3e1c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/fluent/compat/output.rb
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,12 @@ def configure(conf)
conf.elements << Fluent::Config::Element.new('buffer', '', buf_params, [])
end

@includes_record_filter = self.class.ancestors.include?(Fluent::RecordFilterMixin) # TODO rename Compat::RecordFilterMixin

methods_of_plugin = self.class.instance_methods(false)
@overrides_emit = methods_of_plugin.include?(:emit)
@overrides_format_stream = methods_of_plugin.include?(:format_stream)
# RecordFilter mixin uses its own #format_stream method implementation
@overrides_format_stream = methods_of_plugin.include?(:format_stream) || @includes_record_filter

super

Expand Down

0 comments on commit 9cd3e1c

Please sign in to comment.