code: private static void writeToFile(String text, String logFilePath, boolean isDetailed) {
          if (isSDCardAvailable() && isSDCardWritable() && text != null) {
  
              try {
                  File file = new File(logFilePath);
                  OutputStream os = new FileOutputStream(file, true);
                  if (isDetailed) {
                      os.write(("---" + new SimpleDateFormat("yyyy/MM/dd HH:mm:ss.SSS").format(Calendar.getInstance().getTime()) + "---\n").getBytes());
                  }
                  os.write((text + "\n").getBytes());
                  // os.write(("------\n").getBytes());
                  os.close();
              } catch (Exception e) {
                  QuickUtils.log.e("Exception", e);
              }
          } else {
              return;
          }
      }
docs: private write to file method
  
  @param text        text to append
  @param logFilePath path to the file
  @param isDetailed  if it should show the timestamp or not