code: def log_batch(self, log_data):
          
  
          url = uri_join(self.base_url, "log")
  
          attachments = []
          for log_item in log_data:
              log_item["item_id"] = self.stack[-1]
              attachment = log_item.get("attachment", None)
  
              if "attachment" in log_item:
                  del log_item["attachment"]
  
              if attachment:
                  if not isinstance(attachment, collections.Mapping):
                      attachment = {"data": attachment}
  
                  name = attachment.get("name", str(uuid.uuid4()))
                  log_item["file"] = {"name": name}
                  attachments.append(("file", (
                      name,
                      attachment["data"],
                      attachment.get("mime", "application/octet-stream")
                  )))
  
          files = [(
              "json_request_part", (
                  None,
                  json.dumps(log_data),
                  "application/json"
              )
          )]
          files.extend(attachments)
          from reportportal_client import POST_LOGBATCH_RETRY_COUNT
          for i in range(POST_LOGBATCH_RETRY_COUNT):
              try:
                  r = self.session.post(
                      url=url,
                      files=files,
                      verify=self.verify_ssl
                  )
              except KeyError:
                  if i < POST_LOGBATCH_RETRY_COUNT - 1:
                      continue
                  else:
                      raise
              break
  
          logger.debug("log_batch - Stack: %s", self.stack)
          logger.debug("log_batch response: %s", r.text)
  
          return _get_data(r)
docs: Logs batch of messages with attachment.
  
          Args:
              log_data: list of log records.
              log record is a dict of;
                  time, message, level, attachment
                  attachment is a dict of:
                      name: name of attachment
                      data: fileobj or content
                      mime: content type for attachment