function reformatError(logLine) {
  // Due to Winston internals sometimes the error on the logLine object is a string or an
  // empty object, and so the message property is all we have
  const errorMessage = logLine.error.message || logLine.message || ''

  logLine['error.message'] = truncate(errorMessage)
  logLine['error.class'] =
    logLine.error.name === 'Error' ? logLine.error.constructor.name : logLine.error.name
  logLine['error.stack'] = truncate(logLine.error.stack)
  logLine.message = truncate(logLine.message)

  // Removes additional capture of stack to reduce overall payload/log-line size.
  // The server has a maximum of ~4k characters per line allowed.
  delete logLine.trace
  delete logLine.stack
}
Decorates the log line with  truncated error.message, error.class, and error.stack and removes
trace and stack

@param {object} logLine a log line