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

    r31015 r31030  
    2828  */
    2929static bool getRowAttribute(
     30        InitData* this,
    3031        xmlNode* tableNode,
    3132        const char* keyName,
     
    5859    }
    5960
    60     psError(PS_ERR_UNKNOWN,
    61             false,
    62             "* InitData: Could not find value for '%s' for '%s' with value '%s'",
     61    this->logger->print(this->logger, MSG_ERROR,
     62            "InitData: Could not find value for '%s' for '%s' with value '%s'\n",
    6363            attName, keyName, keyValue);
    6464
     
    8383
    8484    if (strcmp((const char*)rootElement->name, "tabledata")!=0) {
    85         psError(PS_ERR_IO, false, "* InitData: Root node of XML is not 'tabledata', as it should be");
     85        this->logger->print(this->logger, MSG_ERROR,
     86                "InitData: Root node of XML is not 'tabledata', as it should be\n");
    8687        return false;
    8788    }
     
    9899            if (strcmp(tempStr, tableName)!=0) continue;
    99100
    100             ret = getRowAttribute(node, keyName, keyValue, attName, attValue);
     101            ret = getRowAttribute(this, node, keyName, keyValue, attName, attValue);
    101102            break;
    102103        }
     
    155156    }
    156157
    157     psLogMsg("ippToPsps", PS_LOG_INFO, "* InitData: destructor");
     158    this->logger->print(this->logger, MSG_DEBUG, "InitData: destructor\n");
    158159
    159160    free(this);
     
    163164  Constructor.
    164165  */
    165 InitData* new_InitData(const char* path) {
     166InitData* new_InitData(const char* path, Logger* logger) {
    166167
    167     psLogMsg("ippToPsps", PS_LOG_INFO, "* InitData: constructor");
     168
    168169
    169170    InitData* this = (InitData*)calloc(1, sizeof(InitData));
     171    this->logger = logger;
     172
     173    this->logger->print(this->logger, MSG_DEBUG, "InitData: Constructor\n");
    170174
    171175    sprintf(this->path, "%s/init/data.xml", path);
    172176
    173177    this->doc = xmlReadFile(this->path, NULL, 0);
    174     if (this->doc == NULL) psError(PS_ERR_IO, false, "* InitData: Unable to open XML file at %s", this->path);
     178    this->logger->print(this->logger, MSG_ERROR,
     179            "InitData: Unable to open XML file at %s\n", this->path);
    175180
    176181    // method pointers
Note: See TracChangeset for help on using the changeset viewer.