def log_updater(log, repetition, optimization_time, modularity_score):
    """ 
    Function to update the log object.
    :param log: The log to update.
    :param repetition: Number of iteration.
    :param optimization_time: Time needed for optimization.
    :param modularity_score: Modularity after the optimization round.
    :return log: Updated log.
    """    
    index = repetition + 1
    log["times"] = log["times"] + [[index, optimization_time]]
    log["cluster_quality"] = log["cluster_quality"] + [[index, modularity_score]]
    return log