import re


def valid_account_id(log, account_id):
    """Validate account Id is a 12 digit string"""
    if not isinstance(account_id, str):
        log.error("supplied account id {} is not a string".format(account_id))
        return False
    id_re = re.compile(r'^\d{12}$')
    if not id_re.match(account_id):
        log.error("supplied account id '{}' must be a 12 digit number".format(account_id))
        return False
    return True