Class: Fluent::TailInput::TailWatcher::TimerWatcher

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(interval, repeat, &callback) ⇒ TimerWatcher

Returns a new instance of TimerWatcher.



1054
1055
1056
1057
1058
# File 'lib/fluent/plugin/in_tail.rb', line 1054

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

Instance Attribute Details

#logObject

Returns the value of attribute log.



1060
1061
1062
# File 'lib/fluent/plugin/in_tail.rb', line 1060

def log
  @log
end

Instance Method Details

#on_timerObject



1062
1063
1064
1065
1066
1067
1068
# File 'lib/fluent/plugin/in_tail.rb', line 1062

def on_timer
  @callback.call
rescue
  # TODO log?
  @log.error $!.to_s
  @log.error_backtrace
end