def with_payload(payload)
      current_payload                   = self.payload
      Thread.current[:sapience_payload] = current_payload ? current_payload.merge(payload) : payload
      yield
    ensure
      Thread.current[:sapience_payload] = current_payload
    end
def with_payload(payload)
      current_payload                   = self.payload
      Thread.current[:sapience_payload] = current_payload ? current_payload.merge(payload) : payload
      yield
    ensure
      Thread.current[:sapience_payload] = current_payload
    end
Thread specific context information to be logged with every log entry

 Add a payload to all log calls on This Thread within the supplied block

   logger.with_payload(tracking_number: 12345) do
     logger.debug('Hello World')
   end

 If a log call already includes a pyload, this payload will be merged with
 the supplied payload, with the supplied payload taking precedence

   logger.with_payload(tracking_number: 12345) do
     logger.debug('Hello World', result: 'blah')
   end