import logging


def norm_range(voltage):
    """Check to see if the voltage values are within the acceptable normal range

    The normal range for the voltage readings is +/- 300 mV. Within the
    assignment, it was asked that if a voltage reading were found to be outside
    of this range, then add a warning entry to the log file indicating the name
    of the file. This function reads in all of the voltage values and checks to
    see that each one is in fact within the acceptable range. If any of the
    voltage readings are outside of this range, a warning entry is made.

    Parameters
    ----------
    voltage : list
        List of floats containing the voltage values

    Returns
    -------
    bool
        True if successful, False if otherwise
    """
    result = all(elem >= -300.0 and elem <= 300.0 for elem in voltage)
    if result is False:
        logging.warning('The voltage data contains an element outside'
                        ' of the normal range of +/- 300 mV')
    return result