import logging


def int_wlog(s, name):
    """
    Convert a string to integer, wrapped so that it issues error to the logging module, with the variable name
    :param s: string to convert
    :param name: variable name, to indicate in the error message
    :return: integer obtained as conversion of s
    """
    try:
        ans = int(s)
    except ValueError as err:
        error_msg = "{} value \"{}\" is not numeric, conversion attempt returned \"{}\""\
            .format(name, s, str(err.args[0]))
        logging.error(error_msg)
        raise ValueError(error_msg)
    return ans