muddydixon/fluent-plugin-anomalydetect — pull request #18 by tkuchiki (2014-09-19 08:55:01+00:00)
Title: Fixed assign the Fluent::Log to Fluent::ChangeFinder

~~~~
# change_finder.rb
def next(x)
...
log.debug "change_finder:#{Thread.current.object_id} x:#{x} xt:#{xt} p:#{p} s:#{s} term:#{@term} r:#{@r} data:#{@data} mu:#{@mu} sigma:#{@sigma} c:#{@c}"
s
end
~~~~

`log.debug` isn't work.

~~~~
# out_anomalydetect.rb
def load_from_file
...
@outliers.each {|outlier| outlier.log = log } # @log is not dumped, so have to set at here
...
end
~~~~

The reason why `@outliers` is nested hash(`outlier` isn't `Fluent::ChangeFinder`).

`@outliers` dump:

~~~~
{:all=>{nil=>#}}
~~~~

This Pull Request is fixed assign the `Fluent::Log` to `Fluent::ChangeFinder`.