async doLog(
    e,
    title = null,
    customError = null,
    logError = true,
    report = true,
    isError = true
  ) {
    if (logError === false) {
      return null;
    }

    const sectionSeperator = `=============================================================`;

    const logType = isError ? `Error` : `Info`;
    let err = `${logType} title: ${title}${EOL}${logType} body: ${EOL}${e?.toString()}${EOL}`;

    // if [e] is an Instance of Error then stringify it
    if (isConsoleError(e)) {
      err += `${logType} Stacktrace: ${EOL}${JSON.stringify(e.stack)}${EOL}`;
    }

    if (!isEmpty(customError)) {
      err += `Custom ${logType}: ${customError?.toString()}${EOL}`;
    }

    // [Privacy] redact home directory path from the error log
    err = redactHomeDirectory(err);

    let _deviceInfoStrigified = '';
    const deviceInfo = getDeviceInfo();
    const mtpMode = getMtpModeSetting();
    const uuid = getMachineId();

    if (!isEmpty(deviceInfo)) {
      Object.keys(deviceInfo).forEach((a) => {
        const item = deviceInfo[a];

        _deviceInfoStrigified += `${a}: ${item}${EOL}`;
      });
    }

    const _date = `Date Time: ${dateTimeUnixTimestampNow({
      monthInletters: true,
    })}`;
    const _appInfo = `${EOL}App Name: ${APP_NAME}${EOL}App Version: ${APP_VERSION}${EOL}UUID: ${uuid}`;
    const _mtpMode = `${EOL}MTP Mode: ${mtpMode}`;
    const _osInfo = `OS type: ${os.type()} / OS Platform: ${os.platform()} / OS Release: ${os.release()}`;
    const _error = `${sectionSeperator}${EOL}${_appInfo}${EOL}${_mtpMode}${EOL}${_date}${EOL}${_osInfo}${EOL}${_deviceInfoStrigified}${logType}: ${err}${EOL}${sectionSeperator}${EOL}`;

    appendFileAsync(logFile, _error);

    if (report) {
      let errorToReport = e;

      if (e && !isConsoleError(e)) {
        // [Privacy] redact home directory path from the error log
        const _e = redactHomeDirectory(e);

        errorToReport = new Error(_e);
      }

      await sentryService.report({ error: errorToReport, title, mtpMode });
    }
  }
@param {any} e - error
@param {boolean} logError - should log the error to the log file
@param {string|null}  customError
@param {any} report - should report the error to crashanalytics services
@param {string|null} title
@param {boolean} isError - is an error or info