}
  protected void logTask(Task aTask, boolean expandTimestamp, boolean isCountedTask) {    if (aTask == null) {      return;    }    String taskStr = buildTaskPrefixString(aTask);    long startTime = -1;    if (TaskUtils.getPreferenceBest(aTask, AspectType.START_TIME) == null) {      taskStr += ",";    } else {      startTime = TaskUtils.getStartTime(aTask);      if (isCountedTask &&          (TaskUtils.isProjection(aTask))) {        startTime = logInvPG.getEffectiveProjectionStart(aTask, startTime);      }      taskStr = taskStr + getDateString(startTime, expandTimestamp) + ",";    }    taskStr = taskStr + getDateString(TaskUtils.getEndTime(aTask), expandTimestamp) + ",";    try {      //This is qty for supply, daily rate for projection      double dQuantity = taskUtils.getDailyQuantity(aTask);      if (!expandTimestamp) {        long dbits = Double.doubleToLongBits(dQuantity);        taskStr = taskStr + Long.toHexString(dbits);      } else {        String testStr = taskStr + dQuantity;        taskStr = testStr;      }    } catch (ClassCastException e) {      logger.error("Formatter:Problem task and the print out is :\n" + taskUtils.taskDesc(aTask));      throw e;    } catch (RuntimeException re) {      if (re.getMessage().indexOf("Assertion botch:") > -1) {        taskStr = taskStr + "Assertion botch!";        String itemId = taskUtils.getTaskItemName(aTask);        TypeIdentificationPG typeIdPG = logInvPG.getResource().getTypeIdentificationPG();        String nomenclature = null;        String orgId = logInvPG.getOrg().getItemIdentificationPG().getItemIdentification();        if (typeIdPG == null) {          logger.warn("No typeIdentificationPG for asset");        } else {          nomenclature = typeIdPG.getNomenclature();        }        if (nomenclature == null) {          nomenclature = itemId;        }        String errorString = "Assertion Botch: start time: " + getDateString(startTime, true);        errorString += (" end time: " + getDateString(TaskUtils.getEndTime(aTask), true));        errorString += (" UID: " + aTask.getUID());        errorString += (" NSN: " + itemId + ":" + nomenclature);        errorString += (" at Org " + orgId + " ");        double dQuantity = taskUtils.getDailyQuantity(aTask);        long dbits = Double.doubleToLongBits(dQuantity);        long rbits = Double.doubleToRawLongBits(dQuantity);        errorString += ("quantity_d: " + Long.toHexString(dbits));        errorString += ("quantity_r: " + Long.toHexString(rbits));        logger.error(errorString, re);      } else {        throw re;  // re-throw for now      }    }    writeln(taskStr);  }