code: private static void logFailedDirective(String sourcePID,
                                             String directive,
                                             Exception e,
                                             String msg) {
          out.println("  <failed directive=\"" + directive + "\" sourcePID=\""
                  + sourcePID + "\">");
          if (e != null) {
              String message = e.getMessage();
              if (message == null) {
                  message = e.getClass().getName();
              }
              out.println("    " + StreamUtility.enc(message));
          } else {
              out.println("    " + StreamUtility.enc(msg));
          }
          out.println("  </failed>");
      }
docs: <p/>
  Write a log of what happened when a directive fails.
  <p/>
  
  @param sourcePID
  - The PID of the object being processed.
  @param directive
  - The name of the directive being processed.
  @param e
  - The Exception that was thrown.
  @param msg
  - A message providing additional info if no Exception was thrown.