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/StackBatch.c

    r31025 r31030  
    6262    long unmatched = 0, totalDetections = 0, numOfDuplicates = 0, numInvalidFlux = 0, numDetectionsOut = 0;
    6363
     64    this->base.logger->print(this->base.logger, MSG_INFO,
     65            "+---------------+---------+----------+------------------+---------------+--------------+\n");
     66    this->base.logger->print(this->base.logger, MSG_INFO,
     67            "|   Extension   | Rows in | Rows out | Missing from DVO | Duplicate IDs | Invalid Flux |\n");
     68
    6469    for (long s=0; s<nDet; s++) {
    6570
     
    102107
    103108    }
    104     psLogMsg("ippToPsps", PS_LOG_INFO,
    105             "+---------------+---------+----------+------------------+---------------+--------------+\n"
    106             "|   Extension   | Rows in | Rows out | Missing from DVO | Duplicate IDs | Invalid Flux |\n"
     109
     110    this->base.logger->print(this->base.logger, MSG_INFO,
    107111            "|  %12s |  %5ld  |   %5ld  |      %5ld       |    %5ld      |    %5ld     |\n",
    108112            extensionName, nDet, numDetectionsOut, unmatched, numOfDuplicates, numInvalidFlux);
     113    this->base.logger->print(this->base.logger, MSG_INFO,
     114            "+---------------+---------+----------+------------------+---------------+--------------+\n");
    109115
    110116
     
    315321
    316322    // open input FITS file
    317     Fits* fitsIn = existing_Fits(this->base.inputFiles[0]);
     323    Fits* fitsIn = existing_Fits(this->base.inputFiles[0], this->base.logger);
    318324    if (fitsIn->getFilePtr(fitsIn) == NULL)  return PS_EXIT_SYS_ERROR;
    319325
     
    425431  Constructor
    426432  */
    427 StackBatch* new_StackBatch(int *argc, char **argv) {
    428 
     433StackBatch* new_StackBatch(Logger* logger, int *argc, char **argv) {
     434
     435    logger->print(logger, MSG_DEBUG, "StackBatch: Constructor\n");
    429436    StackBatch *this = (StackBatch*)calloc(1, sizeof(StackBatch));
    430437
    431438    // call base-class constructor
    432     if (!new_Batch(&this->base)) {
    433 
    434         psError(PS_ERR_IO, false, "Unable to create Batch base-class object");
    435         return this;
    436     }
     439    new_Batch(logger, &this->base);
    437440
    438441    this->MAXDETECT = 150000;
     
    455458    psTimerStart("stackbatch");
    456459
    457     ippToPsps_VersionPrint();
     460//    ippToPsps_VersionPrint();
    458461
    459462    int exitCode;
    460463
    461     StackBatch* stackBatch = new_StackBatch(&argc, argv);
     464    Logger* logger = new_Logger(NULL);
     465
     466    StackBatch* stackBatch = new_StackBatch(logger, &argc, argv);
    462467    stackBatch->base.run(stackBatch);
    463468    exitCode = stackBatch->base.exitCode;
     
    467472    double secs = psTimerMark("stackbatch");
    468473
    469     psLogMsg("stackbatch", 3, "stackbatch completed %ssuccessfully, with exit code %d, in %.1f %s\n",
     474    logger->print(logger, MSG_INFO, "stackbatch completed %ssuccessfully, with exit code %d, in %.1f %s\n",
    470475            (exitCode == PS_EXIT_SUCCESS) ? "" : "un",
    471476            exitCode,
     
    476481    psTimerStop();
    477482    psLibFinalize();
     483    logger->destroy(logger);
    478484
    479485    return exitCode;
Note: See TracChangeset for help on using the changeset viewer.