code: def emit(
              self,
              record):
          
  
          self.debug_log('emit')
  
          try:
              record = self.format_record(
                  record)
          except Exception as e:
              self.write_log(
                  'Exception in Splunk logging handler={}'.format(e))
              self.write_log(
                  traceback.format_exc())
              return
  
          if self.sleep_interval > 0:
              try:
                  self.debug_log('put in queue')
                  # Put log message into queue; worker thread will pick up
                  self.queue.put_nowait(
                      record)
              except Exception as e:
                  self.write_log(
                      'log queue full - log data will be dropped.')
          else:
              # Flush log immediately; is blocking call
              self.publish_to_splunk(
                  payload=record)
docs: emit
  
          Emit handler for queue-ing message for
          the helper thread to send to Splunk on the ``sleep_interval``
  
          :param record: LogRecord to send to Splunk
                         https://docs.python.org/3/library/logging.html