def write_to_log(actual_log_size, max_logsize, value_to_write, log_fp):
    """
    Write down to log the
    :param actual_log_size: Number of performances samples taken (1 sample = values for one cpu)
    :param max_logsize: Maximum number of performances samples allowed
    :param value_to_write: string containing statistics for one cpu
    :param log_fp: File pointer to the log file
    :return:
    """
    if(value_to_write is not None and log_fp):
        log_fp.write(str(value_to_write) + "\n")
        actual_log_size += 1
    return actual_log_size