wd.cdv.validators.registerValidator("custom", function(validation, rs){
  var validationResult = wd.cdv.validationResult({
      name: validation.validationName, 
      type: validation.validationType
  });

  var result = validation.validationFunction.call(this,rs,[]);

  if (typeof result == "object") {
    validationResult.setAlert(wd.cdv.alert(result));
  } else {
    validationResult.setAlert(this.parseAlert(result));
    print(JSON.stringify(validation));
    print(result);
    switch(result){
      case "OK":
        if(validation.successMessage) validationResult.getAlert().setDescription(validation.successMessage);
        break;
      case "CRITICAL":
      case "ERROR":
      case "WARNING":
      default:
        if(validation.failureMessage) validationResult.getAlert().setDescription(validation.failureMessage);
        break;
    }
  }
  return validationResult;
});

wd.cdv.validators.registerValidator("custom", function(validation, rs){
  var validationResult = wd.cdv.validationResult({
      name: validation.validationName, 
      type: validation.validationType
  });

  var result = validation.validationFunction.call(this,rs,[]);

  if (typeof result == "object") {
    validationResult.setAlert(wd.cdv.alert(result));
  } else {
    validationResult.setAlert(this.parseAlert(result));
    switch(result){
      case "OK":
        if(validation.successMessage) validationResult.getAlert().setDescription(validation.successMessage);
        break;
      case "CRITICAL":
      case "ERROR":
      case "WARNING":
      default:
        if(validation.failureMessage) validationResult.getAlert().setDescription(validation.failureMessage);
        break;
    }
  }
  return validationResult;
});

Remove print calls from custom validator
Remove print calls from custom validator

Browsers and server-side CDV seem to have a somewhat
different idea of what 'print' means. Ooops.