code: def run(self):
          
          for line in iter(self.pipeReader.readline, ''):
              self.orig_stdout.write(line.rstrip() + '\n')
              self.orig_stdout.flush()
              if self.log_collection == 'none':
                  # If not match metrics, do not put the line into queue
                  if not self.log_pattern.match(line):
                      continue
              self.queue.put(line)
              
          self.pipeReader.close()
docs: Run the thread, logging everything.
             If the log_collection is 'none', the log content will not be enqueued