def _get_logs(self, app, since=None, filtered=False):
        if not filtered:
            log_file = os.path.join(LogSettings.APPS_DIRECTORY, app + ".log")
        else:
            log_file = os.path.join(LogSettings.APPS_DIRECTORY, app + "-filtered.log")
        with open(log_file, 'r') as f: 
            # TODO this could be made more efficient
            if since: 
                # buffer the whole file (will have to anyway for now) 
                def _line_filter(line):
                    return line != '' and self._parse_time_line(line) > since
                return "\n".join(map(lambda l: l.strip(), filter(_line_filter, f.readlines())))
            else:
                return f.read()
dataset/ETHPy150Open binder-project/binder/binder/binderd/log_reader.py/LogReader._get_logs/original