Class: Fluent::WinEvtLog::WindowsLogWatcher::TimerWatcher

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

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of TimerWatcher.



192
193
194
195
# File 'lib/fluent/plugin/in_winevtlog.rb', line 192

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

Instance Method Details

#on_timerObject



197
198
199
200
201
202
203
# File 'lib/fluent/plugin/in_winevtlog.rb', line 197

def on_timer
  @callback.call
rescue
  # TODO log?

  $log.error $!.to_s
  $log.error_backtrace
end