code: def add_to_queue(self, record):
      # check that we did not loose the reporter sub-process
      if (
          self.is_subprocess_mode()
          and not self._fast_is_subprocess_alive()
          and not self.get_at_exit_state()
      ):  # HANGS IF RACE HOLDS!
          # we lost the reporting subprocess, let's switch to thread mode
          # gel all data, work on local queue:
          self.send_all_records()
          # replace queue:
          self._queue = ForkQueue()
          self._flush = ForkEvent()
          self._event = ForkEvent()
          self._done_ev = ForkEvent()
          self._start_ev = ForkEvent()
          # set thread mode
          self._subprocess = False
          # start background thread
          self._thread = None
          self._start()
          getLogger("clearml.log").warning(
              "Event reporting sub-process lost, switching to thread based reporting"
          )
  
      self._queue.put(record)
  
imports: import json
  import sys
  from pathlib2 import Path
  from logging import LogRecord, getLogger, basicConfig, getLevelName, INFO, WARNING, Formatter, makeLogRecord, warning
  from logging.handlers import BufferingHandler
  from .development.worker import DevWorker
  from ...backend_api.services import events
  from ...backend_api.session.session import MaxRequestSizeError
  from ...config import config
  from ...utilities.process.mp import BackgroundMonitor, ForkEvent, ForkQueue
  from ...utilities.process.mp import SafeQueue, SafeEvent
label_desc: Use image node_id 6 for calling the BackgroundLogService obj's underlying member method code with example usage: obj.add_to_queue(record) without return types