// CmpErrLog::CmpErrLog() constructs a CmpErrLog object and 
// contains all of the calls that are necessary for logging
// information about the current state of the compiler.
CmpErrLog::CmpErrLog(const char *failureTxt, CollHeap *failedHeap, size_t size)
  : fp(0)
{
  // If memory is allocated, then free it to give some extra memory
  // for logging.
  if (memPtr != NULL)
  {
    free(memPtr);
    memPtr = NULL;
  }

  // Create and lock the log file.
  openLogFile();

  // If the log file was opened successfully, then write the
  // information to the log file.
  if (fp != NULL)
  {
    writeHeader(failureTxt, failedHeap, size);
    writeMemoryStats();
    writeAllHeapInfo(failedHeap);
    writeCQDInfo();
    writeQueryInfo();
    writeStackTrace();
    closeLogFile();
  }
}
void SQLMXLoggingArea::logErr97Event(int rc)
{
#if 0
// to be completed, need event id 516 
  const int LEN=8192;
  if (rc == 97) {
    char msg[LEN];
    writeStackTrace(msg, LEN);
    logSQLMXEventForError(SQLMX_ERR97_OCCURED, msg);
  }
#endif
}
void SQLMXLoggingArea::logErr97Event(int rc)
{
#if 0
// to be completed, need event id 516 and proper template in sqf/seapilot/
// source/event_templates/sql.info_event.template.
  const int LEN=8192;
  if (rc == 97) {
    char msg[LEN];
    writeStackTrace(msg, LEN);
    logSQLMXEventForError(SQLMX_ERR97_OCCURED, "ADVANCED", "INFRM", 
			  "LOGONLY", msg);
  }
#endif
}