docs: def emit(self, record):
          """
          Emits a record. The record is sent carefully, according to the following rules, to ensure that data is not
          lost by exceeding the MTU of the connection.
  
          - If the byte-encoded record length plus prefix length plus suffix length plus priority length is less than the
            maximum allowed length, then a single packet is sent, containing the priority, prefix, full record, and
            suffix, in that order.
  
          - If it's greater than or equal to the maximum allowed length and the overflow behavior is set to "truncate,"
            the record is cleanly truncated (being careful not to split in the middle of a multi-byte character), and
            then a single packet is sent, containing the priority, prefix, truncated record, and suffix, in that order.
  
          - If it's greater than or equal to the maximum allowed length and the overflow behavior is set to "fragment,"
            the record preamble (things like file name, logger name, correlation ID, etc.) is extracted from the start
            of the record to calculate a new chunk length. The remainder of the record (which should just be the true
            message and any exception info) is then chunked (being careful not to split in the middle of a multi-byte
            character) into lengths less than or equal to the chunk length, and then the record is sent as multiple
            packets, each packet containing the priority, prefix, record preamble, message chunk, and suffix, in that
            order.
          """
          # noinspection PyBroadException
          try:
              formatted_message = self.format(record)
              encoded_message = formatted_message.encode('utf-8')
  
              prefix = suffix = b''
              if getattr(self, 'ident', False):
                  prefix = self.ident.encode('utf-8') if isinstance(self.ident, six.text_type) else self.ident
              if getattr(self, 'append_nul', True):
                  suffix = '\000'.encode('utf-8')
  
              priority = '<{:d}>'.format(
                  self.encodePriority(self.facility, self.mapPriority(record.levelname))
              ).encode('utf-8')
  
              message_length = len(encoded_message)
              message_length_limit = self.maximum_length - len(prefix) - len(suffix) - len(priority)
  
              if message_length < message_length_limit:
                  parts = [priority + prefix + encoded_message + suffix]
              elif self.overflow == self.OVERFLOW_BEHAVIOR_TRUNCATE:
                  truncated_message, _ = self._cleanly_slice_encoded_string(encoded_message, message_length_limit)
                  parts = [priority + prefix + truncated_message + suffix]
              else:
                  # This can't work perfectly, but it's pretty unusual for a message to go before machine-parseable parts
                  # in the formatted record. So we split the record on the message part. Everything before the split
                  # becomes the preamble and gets repeated every packet. Everything after the split gets chunked. There's
                  # no reason to match on more than the first 40 characters of the message--the chances of that matching
                  # the wrong part of the record are astronomical.
                  try:
                      index = formatted_message.index(record.getMessage()[:40])
                      start_of_message, to_chunk = formatted_message[:index], formatted_message[index:]
                  except (TypeError, ValueError):
                      # We can't locate the message in the formatted record? That's unfortunate. Let's make something up.
                      start_of_message, to_chunk = '{} '.format(formatted_message[:30]), formatted_message[30:]
  
                  start_of_message = start_of_message.encode('utf-8')
                  to_chunk = to_chunk.encode('utf-8')
  
                  # 12 is the length of "... (cont'd)" in bytes
                  chunk_length_limit = message_length_limit - len(start_of_message) - 12
  
                  i = 1
                  parts = []
                  remaining_message = to_chunk
                  while remaining_message:
                      message_id = b''
                      subtractor = 0
                      if i > 1:
                          # If this is not the first message, we determine message # so that we can subtract that length
                          message_id = '{}'.format(i).encode('utf-8')
                          # 14 is the length of "(cont'd #) ..." in bytes
                          subtractor = 14 + len(message_id)
                      chunk, remaining_message = self._cleanly_slice_encoded_string(
                          remaining_message,
                          chunk_length_limit - subtractor,
                      )
                      if i > 1:
                          # If this is not the first message, we prepend the chunk to indicate continuation
                          chunk = b"(cont'd #" + message_id + b') ...' + chunk
                      i += 1
                      if remaining_message:
                          # If this is not the last message, we append the chunk to indicate continuation
                          chunk = chunk + b"... (cont'd)"
                      parts.append(priority + prefix + start_of_message + chunk + suffix)
  
              self._send(parts)
          except Exception:
              self.handleError(record)