Class: Gorgon::OriginatorLogger

Inherits:
Object
  • Object
show all
Includes:
GLogger
Defined in:
lib/gorgon/originator_logger.rb

Constant Summary

Constants included from GLogger

GLogger::SIZE_1_MB

Instance Method Summary collapse

Methods included from GLogger

#initialize_logger, #log, #log_error

Constructor Details

#initialize(log_file) ⇒ OriginatorLogger

Returns a new instance of OriginatorLogger.



7
8
9
# File 'lib/gorgon/originator_logger.rb', line 7

def initialize log_file
  initialize_logger log_file
end

Instance Method Details

#log_message(payload) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/gorgon/originator_logger.rb', line 11

def log_message(payload)
  if payload[:action] == "start"
    log("Started running '#{payload[:filename]}' at '#{payload[:hostname]}:#{payload[:worker_id]}'")
  elsif payload[:action] == "finish"
    print_finish(payload)
  elsif payload[:type] == "crash" || payload[:type] == "exception"
    # TODO: improve logging of these messages
    log(payload)
  else # to be removed
    ap payload
  end
end