code: public String printFailuresLog(Validator validator, Collection<Failure> failures, FailureHelper... fhInput)
     {
        String errorText = "";
        FailureHelper fh = null;
        if (fhInput.length == 0)
           fh = new FailureHelper(failures);
        else
           fh = fhInput[0];
  
        if (failures != null && failures.size() > 0)
        {
           errorText = fh.asText(validator.getResourceBundle());
        }
        return errorText;
     }
docs: print Failures into Log files.
  
  @param validator validator validator validator instance used to run validation rules
  @param failures failures failures the list of Failures to be printed
  @param fhInput fhInput fhInput optional parameter. Normally used only for test or in case of
  FailureHelper already present in context
  @return the error Text