def initMultiprocessing():
 if (not queue):
  return
 for handler in logger.handlers[:]:
  logger.removeHandler(handler)
 queue_handler = QueueHandler(queue)
 queue_handler.setLevel(logging.DEBUG)
 logger.addHandler(queue_handler)
 threading.current_thread().name = multiprocessing.current_process().name

def initMultiprocessing ( ) : if ( not queue ) : return for handler in logger . handlers [ : ] : logger . removeHandler ( handler ) queue_handler = QueueHandler ( queue ) queue_handler . setLevel ( logging . DEBUG ) logger . addHandler ( queue_handler ) threading . current_thread ( ) . name = multiprocessing . current_process ( ) . name
remove all handlers and add queuehandler on top .