src/backend/logging/loggers/wal_frontend_logger.cpp
/**
 * @brief Open logfile and file descriptor
 */
@brief Open logfile and file descriptor
@brief Open logfile and file descriptor
WriteAheadFrontendLogger::WriteAheadFrontendLogger(bool for_testing) {
  logging_type = LOGGING_TYPE_DRAM_NVM;
  recovery_pool = new VarlenPool(BACKEND_TYPE_MM);
  if (for_testing) {
    this->log_file = nullptr;
  } else {
    this->checkpoint.Init();
    LOG_INFO("Log dir is %s", this->peloton_log_directory.c_str());
    this->InitLogDirectory();
    this->InitLogFilesList();
    this->log_file_fd = -1;   
    this->max_commit_id = 0;  
  }
}
WriteAheadFrontendLogger :: WriteAheadFrontendLogger ( bool for_testing ) { logging_type = LOGGING_TYPE_DRAM_NVM ; recovery_pool = new VarlenPool ( BACKEND_TYPE_MM ) ; if ( for_testing ) { this -> log_file = nullptr ; } else { this -> checkpoint . Init ( ) ; LOG_INFO ( " " , this -> peloton_log_directory . c_str ( ) ) ; this -> InitLogDirectory ( ) ; this -> InitLogFilesList ( ) ; this -> log_file_fd = -1 ; this -> max_commit_id = 0 ; } }
@brief Open logfile and file descriptor
@brief Open logfile and file descriptor
/*LOG_INFO("Log File Name :: %s", GetLogFileName().c_str());

  // open log file and file descriptor
  // we open it in append + binary mode
  log_file = fopen(GetLogFileName().c_str(), "ab+");
  if (log_file == NULL) {
    LOG_ERROR("LogFile is NULL");
  }

  // also, get the descriptor
  log_file_fd = fileno(log_file);
  if (log_file_fd == -1) {
    LOG_ERROR("log_file_fd is -1");
  }*/ // allocate pool // TODO cleanup later // abj1 adding code here! // this is a restart or a new start // 0 is unused