Class: Fluent::TailPathInput::TailWatcher::StatWatcher

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

Instance Method Summary collapse

Constructor Details

#initialize(path, &callback) ⇒ StatWatcher

Returns a new instance of StatWatcher.



256
257
258
259
# File 'lib/fluent/plugin/in_tailpath.rb', line 256

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

Instance Method Details

#on_change(prev, cur) ⇒ Object



261
262
263
264
265
266
267
# File 'lib/fluent/plugin/in_tailpath.rb', line 261

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