Sha256: bbac8757758db59502e2ce15aef5b9aac0a0526b4dbe0e063bea49c5b2e46c20
Contents?: true
Size: 942 Bytes
Versions: 24
Compression:
Stored size: 942 Bytes
Contents
require 'gorgon/g_logger' class OriginatorLogger include GLogger def initialize log_file initialize_logger log_file end 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 private def print_finish(payload) msg = "Finished running '#{payload[:filename]}' at '#{payload[:hostname]}:#{payload[:worker_id]}'" msg << failure_message(payload[:failures]) if payload[:type] == "fail" log msg end def failure_message(failures) msg = [] failures.each do |failure| msg << failure end msg << '' msg.join("\n") end end
Version data entries
24 entries across 24 versions & 1 rubygems