code: def reset_logging_framework():
      
      logging._lock = threading.RLock()
  
      # The root logger does not appear in the loggerDict.
      for name in [None] + list(logging.Logger.manager.loggerDict):
          for handler in logging.getLogger(name).handlers:
              handler.createLock()
  
      root = logging.getLogger()
      root.handlers = [
          handler
          for handler in root.handlers
          if not isinstance(handler, mitogen.core.LogHandler)
      ]
docs: After fork, ensure any logging.Handler locks are recreated, as a variety of
      threads in the parent may have been using the logging package at the moment
      of fork.
  
      It is not possible to solve this problem in general; see
      https://github.com/dw/mitogen/issues/150 for a full discussion.