code: static void printToLogFile(String str) {
      try (BufferedWriter bw = new BufferedWriter(new FileWriter(getLogPath(), true))) {
        bw.write(str + logLineBreak);
      } catch (Throwable t) {
        showError(t);
      }
    }
docs: write to log-file