Did I find the right examples for you? yes no

All Samples(3)  |  Call(3)  |  Derive(0)  |  Import(0)
Return a generator that will return the entries in a structured log file.
Note that the caller must not close the file whilst the generator is still
in use.

:param log_f: file-like object containing the raw log entries, one per line
:param raise_on_error: boolean indicating whether ValueError should be raised
                       for lines that cannot be decoded.

        def read(log_f, raise_on_error=False):
    """Return a generator that will return the entries in a structured log file.
    Note that the caller must not close the file whilst the generator is still
    in use.

    :param log_f: file-like object containing the raw log entries, one per line
    :param raise_on_error: boolean indicating whether ValueError should be raised
                           for lines that cannot be decoded."""
    while True:
        line = log_f.readline()
        if not line:
            # This allows log_f to be a stream like stdout
            break
        try:
            yield json.loads(line)
        except ValueError:
            if raise_on_error:
                raise
        


src/w/p/wptrunner-0.2.5/wptrunner/reduce.py   wptrunner(Download)
                statuses[None].add(item["status"])
 
        reader.each_log(reader.read(log_f),
                        {"test_status": handle_status,
                         "test_end": handle_end})
            logger.error("Didn't get any useful output from wptrunner")
            log_f.seek(0)
            for item in reader.read(log_f):
                logger.debug(item)
            return None

src/w/p/wptrunner-0.2.5/wptrunner/metadata.py   wptrunner(Download)
    def update_from_log(self, log_file):
        self.run_info = None
        log_reader = reader.read(log_file)
        reader.each_log(log_reader, self.action_map)