import logging


def time_volt_calcs(time, voltage):
    """Evaluate ECG test duration and calculate max/min voltage values

    The ECG test duration is evaluating by picking out the last time value
    in the time list. The python functions min() and max() are used to
    identify the minimum and maximum voltage values, respectively, from the
    voltage list. These values are appended to a new list variable called
    metrics.

    :param time: list containing ECG test time values
    :param voltage: list containing ECG test voltage values

    :returns: list containing time duration value as a float and min/max
              voltage values as a tuple
    """
    metrics = []
    duration = time[-1]
    metrics.append(duration)
    logging.info('Calculating ECG time duration to be labeled "duration"')
    voltage_extremes = (min(voltage), max(voltage))
    metrics.append(voltage_extremes)
    logging.info('Calculating voltage min and max values to be labeled'
                 ' "voltage_extremes"')
    return metrics