<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def is_valid_device_id(device_id):
 """ Check if device identifier is valid. A valid device identifier contains only ascii word characters or dashes. :param device_id: Device identifier :returns: Valid or not. """

    valid = valid_device_id.match(device_id)
    if not valid:
        logging.error("A valid device identifier contains "
                      "only ascii word characters or dashes. "
                      "Device '%s' not added.", device_id)
    return valid