class_docstr: The reader thread reads log data from pipe
docstr: Setup the object with a logger and a loglevel
  and start the thread
code: def __init__(self, logger, log_collection, log_level=logging.INFO):
      """Setup the object with a logger and a loglevel
      and start the thread
      """
      threading.Thread.__init__(self)
      self.queue = Queue()
      self.logger = logger
      self.daemon = False
      self.log_level = log_level
      self.fdRead, self.fdWrite = os.pipe()
      self.pipeReader = os.fdopen(self.fdRead)
      self.orig_stdout = sys.__stdout__
      self._is_read_completed = False
      self.process_exit = False
      self.log_collection = log_collection
      self.log_pattern = re.compile(r"NNISDK_MEb\'.*\'$")
  
      def _populateQueue(stream, queue):
          """
          Collect lines from 'stream' and put them in 'quque'.
          """
          time.sleep(1)
          while True:
              cur_process_exit = self.process_exit
              try:
                  line = self.queue.get(True, 5)
                  try:
                      self.logger.log(self.log_level, line.rstrip())
                  except Exception:
                      pass
              except Exception:
                  if cur_process_exit == True:
                      self._is_read_completed = True
                      break
  
      self.pip_log_reader_thread = threading.Thread(
          target=_populateQueue, args=(self.pipeReader, self.queue)
      )
      self.pip_log_reader_thread.daemon = True
      self.start()
      self.pip_log_reader_thread.start()
  
imports: import os
  import sys
  import json
  import logging
  import logging.handlers
  import time
  import threading
  import re
  from datetime import datetime
  from enum import Enum, unique
  from logging import StreamHandler
  from queue import Queue
  from .rest_utils import rest_post
  from .url_utils import gen_send_stdout_url
  from .commands import CommandType
label_desc: Use image node_id 1 to create a new PipeLogReader object from inherited base classes: threading with example: obj = PipeLogReader(logger, log_collection, log_level)