Index: trunk/ippToPsps/src/Batch.c
===================================================================
--- trunk/ippToPsps/src/Batch.c	(revision 31032)
+++ trunk/ippToPsps/src/Batch.c	(revision 31033)
@@ -63,5 +63,5 @@
         if (this->exitCode != PS_EXIT_SUCCESS) {
 
-            this->logger->print(this->logger, MSG_ERROR, "Batch: Failed, so deleting fits file\n");
+            this->logger->print(this->logger, MSG_ERROR, "Batch", "Failed, so deleting fits file\n");
             this->fitsOut->delete(this->fitsOut);
         }
@@ -105,5 +105,5 @@
     if (file == NULL) {
 
-        this->logger->print(this->logger, MSG_ERROR, "Batch: Unable to open file at %s\n", this->fitsInPath);
+        this->logger->print(this->logger, MSG_ERROR, "Batch", "Unable to open file at %s\n", this->fitsInPath);
         return false;
     }
@@ -113,5 +113,5 @@
     while (fgets(line, 1000, file) != NULL) this->numOfInputFiles++;
 
-    this->logger->print(this->logger, MSG_INFO, "Batch: %d input files found\n", this->numOfInputFiles);
+    this->logger->print(this->logger, MSG_INFO, "Batch", "%d input files found\n", this->numOfInputFiles);
 
     if (this->numOfInputFiles < 1) return false;
@@ -156,5 +156,5 @@
     if (!this->pmconfig) {
 
-        this->logger->print(this->logger, MSG_ERROR, "Batch: Unable to read configuration\n");
+        this->logger->print(this->logger, MSG_ERROR, "Batch", "Unable to read configuration\n");
         this->exitCode = PS_EXIT_CONFIG_ERROR;
         return false;
Index: trunk/ippToPsps/src/DetectionBatch.c
===================================================================
--- trunk/ippToPsps/src/DetectionBatch.c	(revision 31032)
+++ trunk/ippToPsps/src/DetectionBatch.c	(revision 31033)
@@ -157,7 +157,7 @@
     }
 
-    this->base.logger->print(this->base.logger, MSG_INFO, 
+    this->base.logger->print(this->base.logger, MSG_INFO, "DetectionBatch",  
             "+-----------+---------+----------+----------------+--------------+--------------+\n");
-    this->base.logger->print(this->base.logger, MSG_INFO, 
+    this->base.logger->print(this->base.logger, MSG_INFO, "DetectionBatch",  
             "| Extension | Rows in | Rows out |  Duplicate IDs | Invalid Flux | Bogus det ID |\n");
 
@@ -195,5 +195,5 @@
             skylist = dvoSkyListByExternID(this->base.dvoConfig, sourceId, imageId, &image);
             if (skylist == NULL) {
-                this->base.logger->print(this->base.logger, MSG_ERROR, 
+                this->base.logger->print(this->base.logger, MSG_ERROR, "DetectionBatch",  
                         "DVO: can't find SkyList for sourceId='%d' imageId='%d' (CCD = XY%s): skipping this chip\n",
                         sourceId, imageId, ccdNumber);
@@ -210,5 +210,5 @@
             if (numDvoDetections > this->MAXDETECT ) {
 
-                this->base.logger->print(this->base.logger, MSG_ERROR,"Number of detections (%d) exceeds max limit (%ld)\n",
+                this->base.logger->print(this->base.logger, MSG_ERROR, "DetectionBatch", "Number of detections (%d) exceeds max limit (%ld)\n",
                         numDvoDetections, this->MAXDETECT);
                 error = true;
@@ -375,5 +375,5 @@
             }
 
-            this->base.logger->print(this->base.logger, MSG_INFO,
+            this->base.logger->print(this->base.logger, MSG_INFO, "DetectionBatch",
                     "|  %s |  %5ld  |   %5d  |     %5d      |    %5d     |    %5d     |\n",
                     extensionName, nChipDetectionsIn, nChipDetectionsOut, numOfDuplicates, numInvalidFlux, numOfInvalidIppIDet);
@@ -388,8 +388,8 @@
     }
 
-    this->base.logger->print(this->base.logger, MSG_INFO, 
+    this->base.logger->print(this->base.logger, MSG_INFO, "DetectionBatch",  
             "+-----------+---------+----------+----------------+--------------+--------------+\n");
 
-    this->base.logger->print(this->base.logger, MSG_INFO, "Total detections for this exposure = %ld\n", totalDetectionsOut);
+    this->base.logger->print(this->base.logger, MSG_INFO, "DetectionBatch", "Total detections for this exposure = %ld\n", totalDetectionsOut);
 
     // free-up memory
@@ -425,5 +425,5 @@
     writeResults(this, minObjID, maxObjID, totalDetectionsOut);
 
-    this->base.logger->print(this->base.logger, MSG_INFO, "Data written for a total of %d chips/OTAs", nOta);
+    this->base.logger->print(this->base.logger, MSG_INFO, "DetectionBatch", "Data written for a total of %d chips/OTAs\n", nOta);
 
     if (error || nOta < 1) this->base.exitCode = PS_EXIT_DATA_ERROR;
@@ -487,5 +487,5 @@
             !haveExpName) {
 
-        this->base.logger->print(this->base.logger, MSG_ERROR, "Problem with supplied arguments\n");
+        this->base.logger->print(this->base.logger, MSG_ERROR, "DetectionBatch", "Problem with supplied arguments\n");
         this->print(this);
         this->base.exitCode = PS_EXIT_CONFIG_ERROR;
@@ -501,5 +501,5 @@
 DetectionBatch* new_DetectionBatch(Logger* logger, int *argc, char **argv) {
 
-    logger->print(logger, MSG_DEBUG, "DetectionBatch: Constructor\n");
+    logger->print(logger, MSG_DEBUG, "DetectionBatch", "Constructor\n");
     DetectionBatch *this = (DetectionBatch*)calloc(1, sizeof(DetectionBatch));
 
@@ -526,28 +526,16 @@
 int main(int argc, char **argv) {
 
-    psTimerStart("detectionbatch");
-
 //    ippToPsps_VersionPrint();
 
-    int exitCode;
-
     Logger* logger = new_Logger(NULL);
+    logger->print(logger, MSG_INFO, "main", "Creating new detection batch\n");
 
     DetectionBatch* detectionBatch = new_DetectionBatch(logger, &argc, argv);
     detectionBatch->base.run(detectionBatch);
-    exitCode = detectionBatch->base.exitCode;
+    int exitCode = detectionBatch->base.exitCode;
 
     detectionBatch->destroy(detectionBatch);
 
-    double secs = psTimerMark("detectionbatch");
-
-    logger->print(logger, MSG_INFO, "detectionbatch completed %ssuccessfully, with exit code %d, in %.1f %s\n",
-            (exitCode == PS_EXIT_SUCCESS) ? "" : "un",
-            exitCode,
-            (secs<60.0) ? secs : (secs/60.0),
-            (secs<60.0) ? "sec(s)" : "min(s)");
-
     // tidy up
-    psTimerStop();
     psLibFinalize();
     logger->destroy(logger);
Index: trunk/ippToPsps/src/Fits.c
===================================================================
--- trunk/ippToPsps/src/Fits.c	(revision 31032)
+++ trunk/ippToPsps/src/Fits.c	(revision 31033)
@@ -26,5 +26,5 @@
     if (!strncmp(typename, "TSTRING", 7)) return TSTRING;
 
-//    this->logger->print(this->logger, MSG_ERROR, "Fits: Don't understand data type '%s'", typename);
+//    this->logger->print(this->logger, MSG_ERROR, "Fits", "Don't understand data type '%s'", typename);
 
     return 0;
@@ -36,14 +36,14 @@
 static void destroy(Fits* this) {
 
-    this->logger->print(this->logger, MSG_DEBUG, "Fits: Destructor\n");
+    this->logger->print(this->logger, MSG_DEBUG, "Fits", "Destructor\n");
 
     int status = 0;
     if (fits_close_file(this->file, &status)) {
 
-        this->logger->print(this->logger, MSG_ERROR, "Fits: Unable to close FITS file '%s'\n", this->path);
+        this->logger->print(this->logger, MSG_ERROR, "Fits", "Unable to close FITS file '%s'\n", this->path);
         fits_report_error(stderr, status);
     }
     else 
-        this->logger->print(this->logger, MSG_INFO, "Fits: Closed FITS file '%s'\n", this->path);
+        this->logger->print(this->logger, MSG_INFO, "Fits", "Closed FITS file '%s'\n", this->path);
 
     free(this);
@@ -60,5 +60,5 @@
     if (status) {
 
-        this->logger->print(this->logger, MSG_ERROR, "Fits: Could not get value for header key '%s' from file at '%s'\n", name, this->path);
+        this->logger->print(this->logger, MSG_ERROR, "Fits", "Could not get value for header key '%s' from file at '%s'\n", name, this->path);
         return false;
     }
@@ -86,5 +86,5 @@
     if (status) {
 
-        this->logger->print(this->logger, MSG_ERROR, "Fits: Failed to read vector column %d row %ld\n", col, row);
+        this->logger->print(this->logger, MSG_ERROR, "Fits", "Failed to read vector column %d row %ld\n", col, row);
         return false;
     }
@@ -102,5 +102,5 @@
     if (status) {
 
-        this->logger->print(this->logger, MSG_ERROR, "Fits: Could not get column number for '%s'\n", name);
+        this->logger->print(this->logger, MSG_ERROR, "Fits", "Could not get column number for '%s'\n", name);
         return false;
     }
@@ -123,5 +123,5 @@
     if (status) {
 
-        this->logger->print(this->logger, MSG_ERROR, "Fits: Unable to read col '%s'\n", name);
+        this->logger->print(this->logger, MSG_ERROR, "Fits", "Unable to read col '%s'\n", name);
         return false;
     }
@@ -131,5 +131,5 @@
     if (status) {
 
-        this->logger->print(this->logger, MSG_ERROR, "Fits: Unable to read type info for '%s'\n", name);
+        this->logger->print(this->logger, MSG_ERROR, "Fits", "Unable to read type info for '%s'\n", name);
         return false;
     }
@@ -147,5 +147,5 @@
     if (fits_movnam_hdu(this->file, type, name, 0, &status)) {
 
-        this->logger->print(this->logger, MSG_ERROR, "Fits: Can't move to table extension named '%s'\n", name);
+        this->logger->print(this->logger, MSG_ERROR, "Fits", "Can't move to table extension named '%s'\n", name);
         return false;
     }
@@ -178,5 +178,5 @@
     if (fits_get_num_rows(this->file, count, &status)) {
 
-        this->logger->print(this->logger, MSG_ERROR, "Fits: Count not count rows in this table\n");
+        this->logger->print(this->logger, MSG_ERROR, "Fits", "Count not count rows in this table\n");
         return false;
     }
@@ -201,9 +201,9 @@
     if (remove(this->path) == -1) {
 
-        this->logger->print(this->logger, MSG_ERROR, "Fits: Unable to delete '%s'\n", this->path);
-        return false;
-    }
-
-    this->logger->print(this->logger, MSG_INFO, "Fits: Deleted FITS file at '%s'\n", this->path);
+        this->logger->print(this->logger, MSG_ERROR, "Fits", "Unable to delete '%s'\n", this->path);
+        return false;
+    }
+
+    this->logger->print(this->logger, MSG_INFO, "Fits", "Deleted FITS file at '%s'\n", this->path);
 
     return true;
@@ -235,5 +235,5 @@
     if (status) {
 
-        this->logger->print(this->logger, MSG_ERROR, "Fits: Unable to delete rows using rowlist\n");
+        this->logger->print(this->logger, MSG_ERROR, "Fits", "Unable to delete rows using rowlist\n");
         return false;
     }
@@ -290,11 +290,11 @@
     else {
 
-        this->logger->print(this->logger, MSG_ERROR, "Fits: Don't understand datatype '%d'\n", datatype);
-        return false;
-    }
-
-    if (status) {
-
-        this->logger->print(this->logger, MSG_ERROR, "Fits: Unable to read column data from column %d\n", colnum);
+        this->logger->print(this->logger, MSG_ERROR, "Fits", "Don't understand datatype '%d'\n", datatype);
+        return false;
+    }
+
+    if (status) {
+
+        this->logger->print(this->logger, MSG_ERROR, "Fits", "Unable to read column data from column %d\n", colnum);
         return false;
 
@@ -338,5 +338,5 @@
     if (status) {
 
-        this->logger->print(this->logger, MSG_ERROR, "Fits: Unable to write column data for column %d\n", colnum);
+        this->logger->print(this->logger, MSG_ERROR, "Fits", "Unable to write column data for column %d\n", colnum);
         return false;
 
@@ -362,5 +362,5 @@
     if (status) {
 
-        this->logger->print(this->logger, MSG_ERROR, "Fits: Unable to create table: '%s'\n", name);
+        this->logger->print(this->logger, MSG_ERROR, "Fits", "Unable to create table: '%s'\n", name);
         return false;
     }
@@ -415,10 +415,10 @@
 
     Fits* this = init(path, logger);
-    this->logger->print(this->logger, MSG_DEBUG, "Fits: Constructor for existing file at '%s'\n", path);
+    this->logger->print(this->logger, MSG_DEBUG, "Fits", "Constructor for existing file at '%s'\n", path);
 
     int status = 0;
     if (fits_open_file(&this->file, path, READONLY, &status)) {
 
-        this->logger->print(this->logger, MSG_ERROR, "Fits: Unable to open FITS file here %s\n", path);
+        this->logger->print(this->logger, MSG_ERROR, "Fits", "Unable to open FITS file here %s\n", path);
         this->file = NULL;
     }
@@ -436,10 +436,10 @@
 
     Fits* this = init(path, logger);
-    this->logger->print(this->logger, MSG_DEBUG, "Fits: Constructor for new file at '%s'\n", path);
+    this->logger->print(this->logger, MSG_DEBUG, "Fits", "Constructor for new file at '%s'\n", path);
 
     int status = 0;
     if (fits_create_file(&this->file, path, &status)) {
 
-        this->logger->print(this->logger, MSG_ERROR, "Fits: Unable to create FITS file here '%s'\n", path);
+        this->logger->print(this->logger, MSG_ERROR, "Fits", "Unable to create FITS file here '%s'\n", path);
         this->file = NULL;
     }
Index: trunk/ippToPsps/src/FitsGenerator.c
===================================================================
--- trunk/ippToPsps/src/FitsGenerator.c	(revision 31032)
+++ trunk/ippToPsps/src/FitsGenerator.c	(revision 31033)
@@ -29,5 +29,6 @@
     }
 
-    if (!column) this->logger->print(this->logger, MSG_ERROR, "Could not find column '%s' in table '%s'\n", name, table->name);
+    if (!column) this->logger->print(this->logger, MSG_ERROR, "FitsGenerator", 
+            "Could not find column '%s' in table '%s'\n", name, table->name);
 
     return column;
@@ -49,5 +50,6 @@
     }
 
-    if (!table) this->logger->print(this->logger, MSG_ERROR, "Could not find table '%s'\n", name);
+    if (!table) this->logger->print(this->logger, MSG_ERROR, "FitsGenerator", 
+            "Could not find table '%s'\n", name);
 
     return table;
@@ -217,5 +219,6 @@
 
     xmlDoc* doc = xmlReadFile(path, NULL, 0);
-    if (doc == NULL) this->logger->print(this->logger, MSG_ERROR, "Unable to open XML file at %s\n", path);
+    if (doc == NULL) this->logger->print(this->logger, MSG_ERROR, "FitsGenerator", 
+            "Unable to open XML file at %s\n", path);
     return doc;
 }
@@ -253,5 +256,6 @@
     if(!tableNode) {
 
-        this->logger->print(this->logger, MSG_ERROR, "Could not find table: %s\n", table->name);
+        this->logger->print(this->logger, MSG_ERROR, "FitsGenerator", 
+                "Could not find table: %s\n", table->name);
         return false;
     }
@@ -320,5 +324,6 @@
 
             }
-            if (status) this->logger->print(this->logger, MSG_ERROR, "Unable to write value of %s to column %s in table %s\n", 
+            if (status) this->logger->print(this->logger, MSG_ERROR, "FitsGenerator", 
+                    "Unable to write value of %s to column %s in table %s\n", 
                     tempStr, table->columns[i].pspsName, table->name);
         }
@@ -391,10 +396,13 @@
     if (columnNum < 1) {
 
-        this->logger->print(this->logger, MSG_ERROR, "Found no columns for table '%s'\n", tableName);
+        this->logger->print(this->logger, MSG_ERROR, "FitsGenerator", 
+                "Found no columns for table '%s'\n", tableName);
         ret = false;
     }
 
     if (columnNum != table->numOfColumns)
-        this->logger->print(this->logger, MSG_ERROR, "Mismatch between number of columns expected (%d) and those found (%d)\n", table->numOfColumns, columnNum);
+        this->logger->print(this->logger, MSG_ERROR, "FitsGenerator", 
+                "Mismatch between number of columns expected (%d) and those found (%d)\n", 
+                table->numOfColumns, columnNum);
 
     return ret;
@@ -424,5 +432,6 @@
     if (strcmp((const char*)rootElement->name, "tableDescriptions")!=0) {
 
-        this->logger->print(this->logger, MSG_ERROR, "Root node of XML is not 'tableDescriptions', as it should be\n");
+        this->logger->print(this->logger, MSG_ERROR, "FitsGenerator", 
+                "Root node of XML is not 'tableDescriptions', as it should be\n");
         return false;
     }
@@ -452,5 +461,7 @@
 
     if (tableNum != this->numOfTables)
-        this->logger->print(this->logger, MSG_ERROR, "Mismatch between number of tables expected (%d) and those found (%d)\n", this->numOfTables, tableNum);
+        this->logger->print(this->logger, MSG_ERROR, "FitsGenerator", 
+                "Mismatch between number of tables expected (%d) and those found (%d)\n", 
+                this->numOfTables, tableNum);
 
     closeXmlFile(doc);
@@ -515,6 +526,59 @@
     bool ret = true;
 
+    char path[1000];
+    sprintf(path, "%s/map.xml", this->configsPath);
+
+    struct stat sts;
+    if ((stat(path, &sts)) == -1) {
+        this->logger->print(this->logger, MSG_INFO, "FitsGenerator", 
+                "No map file found at '%s'\n", path);
+        return false;
+    }
+
+    xmlDoc* doc = openXmlFile(this, path);
+
+    if (doc == NULL) {
+        
+        this->logger->print(this->logger, MSG_ERROR,"FitsGenerator",  
+                "Could not create XML document from '%s'\n", path);
+        return false;
+    }
+
+    this->logger->print(this->logger, MSG_INFO, "FitsGenerator", 
+            "Using map file at '%s'\n", path);
+    xmlNode* rootElement = xmlDocGetRootElement(doc);
+
+    if (strcmp((const char*)rootElement->name, "tabledata")!=0) {
+        this->logger->print(this->logger, MSG_ERROR,"FitsGenerator",  
+                "Root node of XML is not 'tabledata', as it should be\n");
+        return false;
+    }
+
+    xmlNode* node = NULL;
+
+    // loop round all available tables
+    for (node = rootElement->children; node; node = node->next) {
+        if (node->type == XML_ELEMENT_NODE) {
+
+            if (strcmp((const char*)node->name, "table")==0) {
+
+                if (!loadTableMappings(this, node)) ret = false;
+            }
+        }
+    }
+
+    closeXmlFile(doc);
+
+    return ret;
+}
+
+/**
+  Populate the provided table with data from XML
+  */
+static bool populateFromFile(FitsGenerator* this, Fits *fitsOut) {
+
+    bool ret = true;
     psString path = NULL;
-    psStringAppend(&path, "%s/map.xml", this->configsPath);
+    psStringAppend(&path, "%s/data.xml", this->configsPath);
 
     xmlDoc* doc = openXmlFile(this, path);
@@ -529,47 +593,6 @@
 
     if (strcmp((const char*)rootElement->name, "tabledata")!=0) {
-        this->logger->print(this->logger, MSG_ERROR, "Root node of XML is not 'tabledata', as it should be\n");
-        return false;
-    }
-
-    xmlNode* node = NULL;
-
-    // loop round all available tables
-    for (node = rootElement->children; node; node = node->next) {
-        if (node->type == XML_ELEMENT_NODE) {
-
-            if (strcmp((const char*)node->name, "table")==0) {
-
-                if (!loadTableMappings(this, node)) ret = false;
-            }
-        }
-    }
-
-    closeXmlFile(doc);
-
-    return ret;
-}
-
-/**
-  Populate the provided table with data from XML
-  */
-static bool populateFromFile(FitsGenerator* this, Fits *fitsOut) {
-
-    bool ret = true;
-    psString path = NULL;
-    psStringAppend(&path, "%s/data.xml", this->configsPath);
-
-    xmlDoc* doc = openXmlFile(this, path);
-
-    if (doc == NULL) {
-        psFree(path);
-        return false;
-    }
-    psFree(path);
-
-    xmlNode* rootElement = xmlDocGetRootElement(doc);
-
-    if (strcmp((const char*)rootElement->name, "tabledata")!=0) {
-        this->logger->print(this->logger, MSG_ERROR, "Root node of XML is not 'tabledata', as it should be\n");
+        this->logger->print(this->logger, MSG_ERROR, "FitsGenerator", 
+                "Root node of XML is not 'tabledata', as it should be\n");
         return false;
     }
@@ -679,5 +702,5 @@
 
                 default:
-                    this->logger->print(this->logger, MSG_ERROR, "Don't know IPP type (%d) for mapping from  '%d'  '%s' to '%s'\n", table->columns[i].ippType,
+                    this->logger->print(this->logger, MSG_ERROR, "FitsGenerator", "Don't know IPP type (%d) for mapping from  '%d'  '%s' to '%s'\n", table->columns[i].ippType,
                             table->columns[i].ippColNum, table->columns[i].ippName, table->columns[i].pspsName);
                     break;
Index: trunk/ippToPsps/src/InitBatch.c
===================================================================
--- trunk/ippToPsps/src/InitBatch.c	(revision 31032)
+++ trunk/ippToPsps/src/InitBatch.c	(revision 31033)
@@ -59,5 +59,5 @@
 InitBatch* new_InitBatch(Logger* logger, int *argc, char **argv) {
 
-    logger->print(logger, MSG_DEBUG, "InitBatch: Constructor\n");
+    logger->print(logger, MSG_DEBUG, "InitBatch", "Constructor\n");
     InitBatch *this = (InitBatch*)calloc(1, sizeof(InitBatch));
 
@@ -80,28 +80,17 @@
 int main(int argc, char **argv) {
 
-    psTimerStart("initbatch");
-
 //    ippToPsps_VersionPrint();
 
-    int exitCode;
-
     Logger* logger = new_Logger(NULL);
+    logger->print(logger, MSG_INFO, "main", "Creating new initialization batch\n");
 
     InitBatch* initBatch = new_InitBatch(logger, &argc, argv);
     initBatch->base.run(initBatch);
-    exitCode = initBatch->base.exitCode;
+    int exitCode = initBatch->base.exitCode;
 
     initBatch->destroy(initBatch);
 
-    double secs = psTimerMark("initbatch");
-
-    logger->print(logger, MSG_INFO, "initbatch completed %ssuccessfully, with exit code %d, in %.1f %s\n",
-            (exitCode == PS_EXIT_SUCCESS) ? "" : "un",
-            exitCode,
-            (secs<60.0) ? secs : (secs/60.0),
-            (secs<60.0) ? "sec(s)" : "min(s)");
 
     // tidy up
-    psTimerStop();
     psLibFinalize();
     logger->destroy(logger);
Index: trunk/ippToPsps/src/InitData.c
===================================================================
--- trunk/ippToPsps/src/InitData.c	(revision 31032)
+++ trunk/ippToPsps/src/InitData.c	(revision 31033)
@@ -60,5 +60,5 @@
 
     this->logger->print(this->logger, MSG_ERROR, 
-            "InitData: Could not find value for '%s' for '%s' with value '%s'\n", 
+            "InitData", "Could not find value for '%s' for '%s' with value '%s'\n", 
             attName, keyName, keyValue);
 
@@ -84,5 +84,5 @@
     if (strcmp((const char*)rootElement->name, "tabledata")!=0) {
         this->logger->print(this->logger, MSG_ERROR, 
-                "InitData: Root node of XML is not 'tabledata', as it should be\n");
+                "InitData", "Root node of XML is not 'tabledata', as it should be\n");
         return false;
     }
@@ -156,5 +156,5 @@
     }
 
-    this->logger->print(this->logger, MSG_DEBUG, "InitData: destructor\n");
+    this->logger->print(this->logger, MSG_DEBUG, "InitData", "Destructor\n");
 
     free(this);
@@ -166,16 +166,20 @@
 InitData* new_InitData(const char* path, Logger* logger) {
 
-
-
     InitData* this = (InitData*)calloc(1, sizeof(InitData));
     this->logger = logger;
 
-    this->logger->print(this->logger, MSG_DEBUG, "InitData: Constructor\n");
+    this->logger->print(this->logger, MSG_DEBUG, "InitData", "Constructor\n");
 
     sprintf(this->path, "%s/init/data.xml", path);
 
     this->doc = xmlReadFile(this->path, NULL, 0);
-    this->logger->print(this->logger, MSG_ERROR, 
-            "InitData: Unable to open XML file at %s\n", this->path);
+
+    if (this->doc == NULL)
+        this->logger->print(this->logger, MSG_ERROR, 
+                "InitData", "Unable to open init data file at '%s'\n", this->path);
+    else
+        this->logger->print(this->logger, MSG_INFO, 
+                "InitData", "Using init data file at '%s'\n", this->path);
+
 
     // method pointers
Index: trunk/ippToPsps/src/StackBatch.c
===================================================================
--- trunk/ippToPsps/src/StackBatch.c	(revision 31032)
+++ trunk/ippToPsps/src/StackBatch.c	(revision 31033)
@@ -58,11 +58,12 @@
     fitsIn->readColumnUsingName(fitsIn, TLONG, "FLAGS2", 1, 1, nDet, flags2);
 
-    printf("Looping through %ld psf detections\n", nDet);
+    this->base.logger->print(this->base.logger, MSG_INFO, "StackBatch", 
+            "Looping through %ld psf detection rows from '%s'\n", nDet, extensionName);
     float mag;
     long unmatched = 0, totalDetections = 0, numOfDuplicates = 0, numInvalidFlux = 0, numDetectionsOut = 0;
 
-    this->base.logger->print(this->base.logger, MSG_INFO,
+    this->base.logger->print(this->base.logger, MSG_INFO, "StackBatch",  
             "+---------------+---------+----------+------------------+---------------+--------------+\n");
-    this->base.logger->print(this->base.logger, MSG_INFO,
+    this->base.logger->print(this->base.logger, MSG_INFO, "StackBatch",  
             "|   Extension   | Rows in | Rows out | Missing from DVO | Duplicate IDs | Invalid Flux |\n");
 
@@ -108,8 +109,8 @@
     }
 
-    this->base.logger->print(this->base.logger, MSG_INFO,
+    this->base.logger->print(this->base.logger, MSG_INFO, "StackBatch",
             "|  %12s |  %5ld  |   %5ld  |      %5ld       |    %5ld      |    %5ld     |\n",
             extensionName, nDet, numDetectionsOut, unmatched, numOfDuplicates, numInvalidFlux);
-    this->base.logger->print(this->base.logger, MSG_INFO,
+    this->base.logger->print(this->base.logger, MSG_INFO, "StackBatch",
             "+---------------+---------+----------+------------------+---------------+--------------+\n");
 
@@ -149,5 +150,7 @@
 
     long nDet = 0;
-    if (!fitsIn->moveToBinaryTableAndCountRows(fitsIn, "SkyChip.xrad", &nDet)) return false;
+    char extensionName[15];
+    sprintf(extensionName, "SkyChip.xrad");
+    if (!fitsIn->moveToBinaryTableAndCountRows(fitsIn, extensionName, &nDet)) return false;
 
 
@@ -172,5 +175,6 @@
     }
 
-    printf("Looping through %ld extended source detections\n", nDet);
+    this->base.logger->print(this->base.logger, MSG_INFO, "StackBatch", 
+            "Looping through %ld extended source detections from extension '%s'\n", nDet, extensionName);
     for (long s=0; s<nDet; s++) {
 
@@ -271,5 +275,7 @@
 
     long nDet = 0;
-    if (!fitsIn->moveToBinaryTableAndCountRows(fitsIn, "SkyChip.xfit", &nDet)) return false;
+    char extensionName[40];
+    sprintf(extensionName, "SkyChip.xfit");
+    if (!fitsIn->moveToBinaryTableAndCountRows(fitsIn, extensionName, &nDet)) return false;
 
     long* ippIdets = (long*)calloc(this->MAXDETECT, sizeof(long));
@@ -281,5 +287,6 @@
     fitsIn->readColumnUsingName(fitsIn, TSTRING, "MODEL_TYPE", 1, 1, nDet, modelTypes);
 
-    printf("Looping through %ld model fit rows\n", nDet);
+    this->base.logger->print(this->base.logger, MSG_INFO, "StackBatch", 
+            "Looping through %ld model fit rows from '%s'\n", nDet, extensionName);
     for (long i = 0; i<nDet; i++) {
 
@@ -360,5 +367,4 @@
     createStackDetectionTable(this, fitsIn, filterIDs, surveyIDs, skycellIDs, exposureTime);
     createStackApFlxTable(this, fitsIn, filterIDs, surveyIDs);
-    printf("dsdsdddds\n\n");
     createStackModelFitTable(this, fitsIn, filterIDs, surveyIDs);
     createStackToImageTable(this, fitsIn);
@@ -433,5 +439,5 @@
 StackBatch* new_StackBatch(Logger* logger, int *argc, char **argv) {
 
-    logger->print(logger, MSG_DEBUG, "StackBatch: Constructor\n");
+    logger->print(logger, MSG_DEBUG, "StackBatch", "Constructor\n");
     StackBatch *this = (StackBatch*)calloc(1, sizeof(StackBatch));
 
@@ -456,6 +462,4 @@
 int main(int argc, char **argv) {
 
-    psTimerStart("stackbatch");
-
 //    ippToPsps_VersionPrint();
 
@@ -463,4 +467,5 @@
 
     Logger* logger = new_Logger(NULL);
+    logger->print(logger, MSG_INFO, "main", "Creating new stack batch\n");
 
     StackBatch* stackBatch = new_StackBatch(logger, &argc, argv);
@@ -470,16 +475,7 @@
     stackBatch->destroy(stackBatch);
 
-    double secs = psTimerMark("stackbatch");
-
-    logger->print(logger, MSG_INFO, "stackbatch completed %ssuccessfully, with exit code %d, in %.1f %s\n",
-            (exitCode == PS_EXIT_SUCCESS) ? "" : "un",
-            exitCode,
-            (secs<60.0) ? secs : (secs/60.0),
-            (secs<60.0) ? "sec(s)" : "min(s)");
-
     // tidy up
-    psTimerStop();
+    logger->destroy(logger);
     psLibFinalize();
-    logger->destroy(logger);
 
     return exitCode;
