Class: Fluent::Plugin::TailInput::StatWatcher

Inherits:
Coolio::StatWatcher
  • Object
show all
Defined in:
lib/fluent/plugin/in_tail.rb

Instance Method Summary collapse

Constructor Details

#initialize(path, log, &callback) ⇒ StatWatcher

Returns a new instance of StatWatcher.



761
762
763
764
765
# File 'lib/fluent/plugin/in_tail.rb', line 761

def initialize(path, log, &callback)
  @callback = callback
  @log = log
  super(path)
end

Instance Method Details

#on_change(prev, cur) ⇒ Object



767
768
769
770
771
772
# File 'lib/fluent/plugin/in_tail.rb', line 767

def on_change(prev, cur)
  @callback.call
rescue
  @log.error $!.to_s
  @log.error_backtrace
end