def _read_proc_stdout(self):
        """reads the burp process stdout and returns a document or None"""
        doc = u''
        js = None
        while True:
            try:
                if not self._proc_is_alive():
                    raise Exception('process died while reading its output')
                r, _, _ = select([self.proc.stdout], [], [], self.timeout)
                if self.proc.stdout not in r:
                    raise TimeoutError('Read operation timed out')
                doc += self.proc.stdout.readline().rstrip('\n')
                js = self._is_valid_json(doc)
                # if the string is a valid json and looks like a logline, we
                # simply ignore it
                if js and self._is_ignored(js):
                    doc = ''
                    continue
                elif js:
                    break
            except (TimeoutError, IOError, Exception) as e:
                # the os throws an exception if there is no data or timeout
                self._logger('warning', str(e))
                self._kill_burp()
                break
        return js
dataset/ETHPy150Open ziirish/burp-ui/burpui/misc/backend/burp2.py/Burp._read_proc_stdout/original