import logging


def validate_ip_address(in_ip_string: str)->bool:
    """
    validate an IP address string
    :param in_ip_string: a string containing a possible ip address.
    :return: True if the string is a valid IPV4 address
    """
    if "." not in in_ip_string:
        logging.error("invalid IP: {}, no . in IP address"
                      .format(in_ip_string))
        return False

    octets = in_ip_string.split(".")
    if len(octets) != 4:
        logging.error("invalid IP: {}, IP does not contain 4 octets"
                      .format(in_ip_string))
        return False

    prev_octet_int = 1
    for octet in octets:
        try:
            octet_int = int(octet)
            if octet_int < 0 or octet_int > 255:
                logging.error("invalid IP: {}, IP octet {} < 0 or > 255"
                              .format(in_ip_string, octet_int))
                return False
            if octet_int != 0 and prev_octet_int == 0:
                logging.error("invalid IP: {}, IP octet not 0, but "
                              "previous octet was 0".format(in_ip_string))
                return False
            prev_octet_int = octet_int
        except ValueError:
            logging.error("invalid IP: {}, IP octet {} not an integer"
                          .format(in_ip_string, octet))

    return True