def ValidateAndLog(self, log):
    """Validates an @ time spec line and logs any errors and warnings.

    Args:
      log: A LogCounter instance to record issues.
    """
    self._CheckTimeField(log)

    # User checks.
    if self.user in USER_WHITELIST:
      return
    elif len(self.user) > 31:
      log.LineError(log.MSG_INVALID_USER,
                    'Username too long "%s"' % self.user)
    elif self.user.startswith('-'):
      log.LineError(log.MSG_INVALID_USER, 'Invalid username "%s"' % self.user)
    elif re.search(r'[\s!"#$%&\'()*+,/:;<=>?@[\\\]^`{|}~]', self.user):
      log.LineError(log.MSG_INVALID_USER, 'Invalid username "%s"' % self.user)
    else:
      try:
        pwd.getpwnam(self.user)
      except __HOLE__:
        log.LineWarn(log.MSG_USER_NOT_FOUND,
                     'User "%s" not found.' % self.user)

    # Command checks.
    if self.command.startswith('%') or re.search(r'[^\\]%', self.command):
      log.LineWarn(log.MSG_BARE_PERCENT, 'A bare % is a line break in'
                   ' crontab and is commonly not intended.')
dataset/ETHPy150Open lyda/chkcrontab/chkcrontab_lib.py/CronLineTimeAction.ValidateAndLog