Class: Gorgon::OriginatorLogger
- Inherits:
-
Object
- Object
- Gorgon::OriginatorLogger
- Includes:
- GLogger
- Defined in:
- lib/gorgon/originator_logger.rb
Constant Summary
Constants included from GLogger
Instance Method Summary collapse
-
#initialize(log_file) ⇒ OriginatorLogger
constructor
A new instance of OriginatorLogger.
- #log_message(payload) ⇒ Object
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 (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 |