def METHOD_NAME(rotating_logger, num_logs, lines, binary, wait=None):
    file_num = 0
    log_content = []
    while True:
        for i in range(lines):
            line = f"Test_log {file_num}.{i}"
            if binary:
                content = (line + os.linesep).encode()
            else:
                content = line + "\n"
            log_content.append(content)
            rotating_logger.info(line)
        file_num += 1
        if file_num < num_logs:
            if wait:
                time.sleep(wait)
            rotating_logger.doRollover()
        else:
            break
    return log_content