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;
});

@@ -424,66 +424,8 @@
 ));%0A
-    print(JSON.stringify(validation));%0A    print(result);%0A
     

Remove print calls from custom validator