def METHOD_NAME(self, logid, first_line, last_line):
    if logid not in self.logs or first_line > last_line:
        return defer.succeed('')
    lines = self.log_lines.get(logid, [])
    rv = lines[first_line:last_line + 1]
    return defer.succeed('\n'.join(rv) + '\n' if rv else '')