IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 24, 2011, 11:03:32 AM (15 years ago)
Author:
rhenders
Message:

Changes to reflect those in Logger class

File:
1 edited

Legend:

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

    r31030 r31033  
    157157    }
    158158
    159     this->base.logger->print(this->base.logger, MSG_INFO,
     159    this->base.logger->print(this->base.logger, MSG_INFO, "DetectionBatch", 
    160160            "+-----------+---------+----------+----------------+--------------+--------------+\n");
    161     this->base.logger->print(this->base.logger, MSG_INFO,
     161    this->base.logger->print(this->base.logger, MSG_INFO, "DetectionBatch", 
    162162            "| Extension | Rows in | Rows out |  Duplicate IDs | Invalid Flux | Bogus det ID |\n");
    163163
     
    195195            skylist = dvoSkyListByExternID(this->base.dvoConfig, sourceId, imageId, &image);
    196196            if (skylist == NULL) {
    197                 this->base.logger->print(this->base.logger, MSG_ERROR,
     197                this->base.logger->print(this->base.logger, MSG_ERROR, "DetectionBatch", 
    198198                        "DVO: can't find SkyList for sourceId='%d' imageId='%d' (CCD = XY%s): skipping this chip\n",
    199199                        sourceId, imageId, ccdNumber);
     
    210210            if (numDvoDetections > this->MAXDETECT ) {
    211211
    212                 this->base.logger->print(this->base.logger, MSG_ERROR,"Number of detections (%d) exceeds max limit (%ld)\n",
     212                this->base.logger->print(this->base.logger, MSG_ERROR, "DetectionBatch", "Number of detections (%d) exceeds max limit (%ld)\n",
    213213                        numDvoDetections, this->MAXDETECT);
    214214                error = true;
     
    375375            }
    376376
    377             this->base.logger->print(this->base.logger, MSG_INFO,
     377            this->base.logger->print(this->base.logger, MSG_INFO, "DetectionBatch",
    378378                    "|  %s |  %5ld  |   %5d  |     %5d      |    %5d     |    %5d     |\n",
    379379                    extensionName, nChipDetectionsIn, nChipDetectionsOut, numOfDuplicates, numInvalidFlux, numOfInvalidIppIDet);
     
    388388    }
    389389
    390     this->base.logger->print(this->base.logger, MSG_INFO,
     390    this->base.logger->print(this->base.logger, MSG_INFO, "DetectionBatch", 
    391391            "+-----------+---------+----------+----------------+--------------+--------------+\n");
    392392
    393     this->base.logger->print(this->base.logger, MSG_INFO, "Total detections for this exposure = %ld\n", totalDetectionsOut);
     393    this->base.logger->print(this->base.logger, MSG_INFO, "DetectionBatch", "Total detections for this exposure = %ld\n", totalDetectionsOut);
    394394
    395395    // free-up memory
     
    425425    writeResults(this, minObjID, maxObjID, totalDetectionsOut);
    426426
    427     this->base.logger->print(this->base.logger, MSG_INFO, "Data written for a total of %d chips/OTAs", nOta);
     427    this->base.logger->print(this->base.logger, MSG_INFO, "DetectionBatch", "Data written for a total of %d chips/OTAs\n", nOta);
    428428
    429429    if (error || nOta < 1) this->base.exitCode = PS_EXIT_DATA_ERROR;
     
    487487            !haveExpName) {
    488488
    489         this->base.logger->print(this->base.logger, MSG_ERROR, "Problem with supplied arguments\n");
     489        this->base.logger->print(this->base.logger, MSG_ERROR, "DetectionBatch", "Problem with supplied arguments\n");
    490490        this->print(this);
    491491        this->base.exitCode = PS_EXIT_CONFIG_ERROR;
     
    501501DetectionBatch* new_DetectionBatch(Logger* logger, int *argc, char **argv) {
    502502
    503     logger->print(logger, MSG_DEBUG, "DetectionBatch: Constructor\n");
     503    logger->print(logger, MSG_DEBUG, "DetectionBatch", "Constructor\n");
    504504    DetectionBatch *this = (DetectionBatch*)calloc(1, sizeof(DetectionBatch));
    505505
     
    526526int main(int argc, char **argv) {
    527527
    528     psTimerStart("detectionbatch");
    529 
    530528//    ippToPsps_VersionPrint();
    531529
    532     int exitCode;
    533 
    534530    Logger* logger = new_Logger(NULL);
     531    logger->print(logger, MSG_INFO, "main", "Creating new detection batch\n");
    535532
    536533    DetectionBatch* detectionBatch = new_DetectionBatch(logger, &argc, argv);
    537534    detectionBatch->base.run(detectionBatch);
    538     exitCode = detectionBatch->base.exitCode;
     535    int exitCode = detectionBatch->base.exitCode;
    539536
    540537    detectionBatch->destroy(detectionBatch);
    541538
    542     double secs = psTimerMark("detectionbatch");
    543 
    544     logger->print(logger, MSG_INFO, "detectionbatch completed %ssuccessfully, with exit code %d, in %.1f %s\n",
    545             (exitCode == PS_EXIT_SUCCESS) ? "" : "un",
    546             exitCode,
    547             (secs<60.0) ? secs : (secs/60.0),
    548             (secs<60.0) ? "sec(s)" : "min(s)");
    549 
    550539    // tidy up
    551     psTimerStop();
    552540    psLibFinalize();
    553541    logger->destroy(logger);
Note: See TracChangeset for help on using the changeset viewer.