lib/dispatch-rider/logging/text_formatter.rb in dispatch-rider-1.9.0 vs lib/dispatch-rider/logging/text_formatter.rb in dispatch-rider-2.0.0
- old
+ new
@@ -1,10 +1,9 @@
# Text Log Formatter
module DispatchRider
module Logging
class TextFormatter
-
def format(data)
case data[:phase]
when :complete
"Completed execution of: #{message_info_fragment(data)} in #{format_duration(data[:duration])} seconds"
when :fail
@@ -12,11 +11,11 @@
when :start
"Starting execution of: #{message_info_fragment(data)}"
when :success
"Succeeded execution of: #{message_info_fragment(data)}"
when :stop
- "Got stop #{data[:reason] ? '(' + data[:reason] + ')' : '' } while executing: #{message_info_fragment(data)}"
+ "Got stop #{data[:reason] ? '(' + data[:reason] + ')' : ''} while executing: #{message_info_fragment(data)}"
when :error_handler_fail
"Failed error handling of: #{exception_info_fragment(data)}"
else
raise ArgumentError, "Invalid phase : #{data[:phase].inspect}"
end
@@ -40,9 +39,8 @@
end
def format_duration(duration)
'%.2f' % [duration]
end
-
end
end
end