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.



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

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

Instance Method Details

#on_change(prev, cur) ⇒ Object



576
577
578
579
580
581
582
# File 'lib/fluent/plugin/in_tail.rb', line 576

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