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

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, &callback) ⇒ StatWatcher

Returns a new instance of StatWatcher.



1072
1073
1074
1075
1076
# File 'lib/fluent/plugin/in_tail.rb', line 1072

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

Instance Attribute Details

#logObject

Returns the value of attribute log.



1078
1079
1080
# File 'lib/fluent/plugin/in_tail.rb', line 1078

def log
  @log
end

Instance Method Details

#on_change(prev, cur) ⇒ Object



1080
1081
1082
1083
1084
1085
1086
# File 'lib/fluent/plugin/in_tail.rb', line 1080

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