Module: Shift::Api::Core::Formatters::Logger

Defined in:
lib/shift/api/core/formatters/logger.rb

Class Method Summary collapse

Class Method Details

.message_from_request_body(env, request_id) ⇒ Object



6
7
8
9
10
11
# File 'lib/shift/api/core/formatters/logger.rb', line 6

def self.message_from_request_body(env, request_id)
  msg = "Shift Request (#{ request_id }): #{ env.method.to_s.upcase } to #{ env.url }"
  body = env.body
  msg << " with body \"#{ body }\"" unless body.empty?
  msg
end

.message_from_response_body(env, request_id) ⇒ Object



13
14
15
# File 'lib/shift/api/core/formatters/logger.rb', line 13

def self.message_from_response_body(env, request_id)
  "Shift Response (#{ request_id }): #{ env[:raw_body] }"
end