code: public static PrintWriter createLog(File logDir, String callpath)
              throws Exception {
          if (logDir != null) {
              File dir = new File(logDir, callpath);
              String path=logDir.toString() + "/" + callpath.split("/")[0];
              System.setProperty("PATH", path);
              dir.mkdir();
              File f = new File(dir, "log.xml");
              f.delete();
              BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(
                      new FileOutputStream(f), "UTF-8"));
              return new PrintWriter(writer);
          }
          return null;
      }
docs: Creates a Writer used to write test results to the log.xml file.
  
  @param logDir
  The directory containing the test session results.
  @param callpath
  A test session identifier.
  @return A PrintWriter object, or {@code null} if one could not be
  created.
  @throws Exception