IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 23, 2011, 4:27:17 PM (15 years ago)
Author:
rhenders
Message:

Introduced new logging system in order to provide proper audit trail

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/src/Batch.c

    r31025 r31030  
    6363        if (this->exitCode != PS_EXIT_SUCCESS) {
    6464
    65             psError(PS_ERR_UNKNOWN, false, "Failed, so deleting fits file");
     65            this->logger->print(this->logger, MSG_ERROR, "Batch: Failed, so deleting fits file\n");
    6666            this->fitsOut->delete(this->fitsOut);
    6767        }
     
    105105    if (file == NULL) {
    106106
    107         psError(PS_ERR_UNKNOWN, false, "Unable to open file at %s", this->fitsInPath);
     107        this->logger->print(this->logger, MSG_ERROR, "Batch: Unable to open file at %s\n", this->fitsInPath);
    108108        return false;
    109109    }
     
    113113    while (fgets(line, 1000, file) != NULL) this->numOfInputFiles++;
    114114
    115     printf ("Number of input files %d\n", this->numOfInputFiles);
     115    this->logger->print(this->logger, MSG_INFO, "Batch: %d input files found\n", this->numOfInputFiles);
    116116
    117117    if (this->numOfInputFiles < 1) return false;
     
    156156    if (!this->pmconfig) {
    157157
    158         psError(PS_ERR_UNKNOWN, false, "Unable to read configuration.");
     158        this->logger->print(this->logger, MSG_ERROR, "Batch: Unable to read configuration\n");
    159159        this->exitCode = PS_EXIT_CONFIG_ERROR;
    160160        return false;
     
    220220
    221221    // create an InitData object and get survey ID
    222     this->initData = new_InitData(configsBaseDir);
     222    this->initData = new_InitData(configsBaseDir, this->logger);
    223223    if (strlen(this->surveyType) > 0 &&
    224224            !this->initData->getSurveyId(this->initData, this->surveyType, &this->surveyID)) {
     
    230230    // create a FitsGenerator object
    231231    strcat(configsBaseDir, configsDir);
    232     this->fitsGenerator = new_FitsGenerator(configsBaseDir);
     232    this->fitsGenerator = new_FitsGenerator(this->logger, configsBaseDir);
    233233
    234234    // create full FITS out path
     
    236236
    237237    // create an output FITS file
    238     this->fitsOut = new_Fits(fitsOutPath);
     238    this->fitsOut = new_Fits(fitsOutPath, this->logger);
    239239    if (this->fitsOut->getFilePtr(this->fitsOut) == NULL) return false;
    240240
     
    306306  Constructor. Takes a Batch object and initialises it.
    307307  */
    308 bool new_Batch(Batch *this) {
    309 
     308bool new_Batch(Logger* logger, Batch *this) {
     309
     310    this->logger = logger;
    310311    this->surveyID = -1;
    311312    this->resultsXmlDoc = NULL;
Note: See TracChangeset for help on using the changeset viewer.