Class: SimpleWorker::LoggingListener

Inherits:
AbstractListener show all
Defined in:
lib/simpleworker/logging_listener.rb

Constant Summary collapse

TIME_FORMAT =
"%Y-%m-%d %H:%M:%S"

Instance Method Summary collapse

Methods inherited from AbstractListener

#update

Constructor Details

#initialize(io = STDOUT) ⇒ LoggingListener

Returns a new instance of LoggingListener.



7
8
9
# File 'lib/simpleworker/logging_listener.rb', line 7

def initialize(io = STDOUT)
  @io = io
end

Instance Method Details

#on_interruptedObject



47
48
49
# File 'lib/simpleworker/logging_listener.rb', line 47

def on_interrupted
  log.info "interrupted"
end

#on_log(hostname, msg) ⇒ Object



43
44
45
# File 'lib/simpleworker/logging_listener.rb', line 43

def on_log(hostname, msg)
  log.info "host: #{hostname} #{msg}"
end

#on_node_start(hostname) ⇒ Object



19
20
21
# File 'lib/simpleworker/logging_listener.rb', line 19

def on_node_start(hostname)
  log.info "start node: #{hostname}"
end

#on_node_stop(hostname) ⇒ Object



23
24
25
# File 'lib/simpleworker/logging_listener.rb', line 23

def on_node_stop(hostname)
  log.info "stop node: #{hostname}"
end

#on_start(jobid) ⇒ Object



11
12
13
# File 'lib/simpleworker/logging_listener.rb', line 11

def on_start(jobid)
  log.info "start: #{jobid}"
end

#on_stopObject



15
16
17
# File 'lib/simpleworker/logging_listener.rb', line 15

def on_stop
  log.info "stop"
end

#on_task_active(hostname, task) ⇒ Object



31
32
33
# File 'lib/simpleworker/logging_listener.rb', line 31

def on_task_active(hostname, task)
  log.info "active host: #{hostname} task: #{task}"
end

#on_task_expire(hostname, task) ⇒ Object



39
40
41
# File 'lib/simpleworker/logging_listener.rb', line 39

def on_task_expire(hostname, task)
  log.info "expire host: #{hostname} task: #{task}"
end

#on_task_start(hostname, task) ⇒ Object



27
28
29
# File 'lib/simpleworker/logging_listener.rb', line 27

def on_task_start(hostname, task)
  log.info "start host: #{hostname} task: #{task}"
end

#on_task_stop(hostname, task) ⇒ Object



35
36
37
# File 'lib/simpleworker/logging_listener.rb', line 35

def on_task_stop(hostname, task)
  log.info "stop host: #{hostname} task: #{task}"
end

#on_timeoutObject



51
52
53
# File 'lib/simpleworker/logging_listener.rb', line 51

def on_timeout
  log.info "timeout"
end