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

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

Instance Method Summary collapse

Constructor Details

#initialize(watcher, &callback) ⇒ StatWatcher

Returns a new instance of StatWatcher.



561
562
563
564
565
# File 'lib/fluent/plugin/in_tail.rb', line 561

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

Instance Method Details

#on_change(prev, cur) ⇒ Object



567
568
569
570
571
572
573
# File 'lib/fluent/plugin/in_tail.rb', line 567

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