Class: Fluent::TailInput::TailWatcher::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.



543
544
545
546
547
# File 'lib/fluent/plugin/in_tail.rb', line 543

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

Instance Method Details

#on_change(prev, cur) ⇒ Object



549
550
551
552
553
554
555
# File 'lib/fluent/plugin/in_tail.rb', line 549

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