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

    r31030 r31033  
    2626    if (!strncmp(typename, "TSTRING", 7)) return TSTRING;
    2727
    28 //    this->logger->print(this->logger, MSG_ERROR, "Fits: Don't understand data type '%s'", typename);
     28//    this->logger->print(this->logger, MSG_ERROR, "Fits", "Don't understand data type '%s'", typename);
    2929
    3030    return 0;
     
    3636static void destroy(Fits* this) {
    3737
    38     this->logger->print(this->logger, MSG_DEBUG, "Fits: Destructor\n");
     38    this->logger->print(this->logger, MSG_DEBUG, "Fits", "Destructor\n");
    3939
    4040    int status = 0;
    4141    if (fits_close_file(this->file, &status)) {
    4242
    43         this->logger->print(this->logger, MSG_ERROR, "Fits: Unable to close FITS file '%s'\n", this->path);
     43        this->logger->print(this->logger, MSG_ERROR, "Fits", "Unable to close FITS file '%s'\n", this->path);
    4444        fits_report_error(stderr, status);
    4545    }
    4646    else
    47         this->logger->print(this->logger, MSG_INFO, "Fits: Closed FITS file '%s'\n", this->path);
     47        this->logger->print(this->logger, MSG_INFO, "Fits", "Closed FITS file '%s'\n", this->path);
    4848
    4949    free(this);
     
    6060    if (status) {
    6161
    62         this->logger->print(this->logger, MSG_ERROR, "Fits: Could not get value for header key '%s' from file at '%s'\n", name, this->path);
     62        this->logger->print(this->logger, MSG_ERROR, "Fits", "Could not get value for header key '%s' from file at '%s'\n", name, this->path);
    6363        return false;
    6464    }
     
    8686    if (status) {
    8787
    88         this->logger->print(this->logger, MSG_ERROR, "Fits: Failed to read vector column %d row %ld\n", col, row);
     88        this->logger->print(this->logger, MSG_ERROR, "Fits", "Failed to read vector column %d row %ld\n", col, row);
    8989        return false;
    9090    }
     
    102102    if (status) {
    103103
    104         this->logger->print(this->logger, MSG_ERROR, "Fits: Could not get column number for '%s'\n", name);
     104        this->logger->print(this->logger, MSG_ERROR, "Fits", "Could not get column number for '%s'\n", name);
    105105        return false;
    106106    }
     
    123123    if (status) {
    124124
    125         this->logger->print(this->logger, MSG_ERROR, "Fits: Unable to read col '%s'\n", name);
     125        this->logger->print(this->logger, MSG_ERROR, "Fits", "Unable to read col '%s'\n", name);
    126126        return false;
    127127    }
     
    131131    if (status) {
    132132
    133         this->logger->print(this->logger, MSG_ERROR, "Fits: Unable to read type info for '%s'\n", name);
     133        this->logger->print(this->logger, MSG_ERROR, "Fits", "Unable to read type info for '%s'\n", name);
    134134        return false;
    135135    }
     
    147147    if (fits_movnam_hdu(this->file, type, name, 0, &status)) {
    148148
    149         this->logger->print(this->logger, MSG_ERROR, "Fits: Can't move to table extension named '%s'\n", name);
     149        this->logger->print(this->logger, MSG_ERROR, "Fits", "Can't move to table extension named '%s'\n", name);
    150150        return false;
    151151    }
     
    178178    if (fits_get_num_rows(this->file, count, &status)) {
    179179
    180         this->logger->print(this->logger, MSG_ERROR, "Fits: Count not count rows in this table\n");
     180        this->logger->print(this->logger, MSG_ERROR, "Fits", "Count not count rows in this table\n");
    181181        return false;
    182182    }
     
    201201    if (remove(this->path) == -1) {
    202202
    203         this->logger->print(this->logger, MSG_ERROR, "Fits: Unable to delete '%s'\n", this->path);
    204         return false;
    205     }
    206 
    207     this->logger->print(this->logger, MSG_INFO, "Fits: Deleted FITS file at '%s'\n", this->path);
     203        this->logger->print(this->logger, MSG_ERROR, "Fits", "Unable to delete '%s'\n", this->path);
     204        return false;
     205    }
     206
     207    this->logger->print(this->logger, MSG_INFO, "Fits", "Deleted FITS file at '%s'\n", this->path);
    208208
    209209    return true;
     
    235235    if (status) {
    236236
    237         this->logger->print(this->logger, MSG_ERROR, "Fits: Unable to delete rows using rowlist\n");
     237        this->logger->print(this->logger, MSG_ERROR, "Fits", "Unable to delete rows using rowlist\n");
    238238        return false;
    239239    }
     
    290290    else {
    291291
    292         this->logger->print(this->logger, MSG_ERROR, "Fits: Don't understand datatype '%d'\n", datatype);
    293         return false;
    294     }
    295 
    296     if (status) {
    297 
    298         this->logger->print(this->logger, MSG_ERROR, "Fits: Unable to read column data from column %d\n", colnum);
     292        this->logger->print(this->logger, MSG_ERROR, "Fits", "Don't understand datatype '%d'\n", datatype);
     293        return false;
     294    }
     295
     296    if (status) {
     297
     298        this->logger->print(this->logger, MSG_ERROR, "Fits", "Unable to read column data from column %d\n", colnum);
    299299        return false;
    300300
     
    338338    if (status) {
    339339
    340         this->logger->print(this->logger, MSG_ERROR, "Fits: Unable to write column data for column %d\n", colnum);
     340        this->logger->print(this->logger, MSG_ERROR, "Fits", "Unable to write column data for column %d\n", colnum);
    341341        return false;
    342342
     
    362362    if (status) {
    363363
    364         this->logger->print(this->logger, MSG_ERROR, "Fits: Unable to create table: '%s'\n", name);
     364        this->logger->print(this->logger, MSG_ERROR, "Fits", "Unable to create table: '%s'\n", name);
    365365        return false;
    366366    }
     
    415415
    416416    Fits* this = init(path, logger);
    417     this->logger->print(this->logger, MSG_DEBUG, "Fits: Constructor for existing file at '%s'\n", path);
     417    this->logger->print(this->logger, MSG_DEBUG, "Fits", "Constructor for existing file at '%s'\n", path);
    418418
    419419    int status = 0;
    420420    if (fits_open_file(&this->file, path, READONLY, &status)) {
    421421
    422         this->logger->print(this->logger, MSG_ERROR, "Fits: Unable to open FITS file here %s\n", path);
     422        this->logger->print(this->logger, MSG_ERROR, "Fits", "Unable to open FITS file here %s\n", path);
    423423        this->file = NULL;
    424424    }
     
    436436
    437437    Fits* this = init(path, logger);
    438     this->logger->print(this->logger, MSG_DEBUG, "Fits: Constructor for new file at '%s'\n", path);
     438    this->logger->print(this->logger, MSG_DEBUG, "Fits", "Constructor for new file at '%s'\n", path);
    439439
    440440    int status = 0;
    441441    if (fits_create_file(&this->file, path, &status)) {
    442442
    443         this->logger->print(this->logger, MSG_ERROR, "Fits: Unable to create FITS file here '%s'\n", path);
     443        this->logger->print(this->logger, MSG_ERROR, "Fits", "Unable to create FITS file here '%s'\n", path);
    444444        this->file = NULL;
    445445    }
Note: See TracChangeset for help on using the changeset viewer.