Index: trunk/psLib/src/sys/psTrace.c
===================================================================
--- trunk/psLib/src/sys/psTrace.c	(revision 1700)
+++ trunk/psLib/src/sys/psTrace.c	(revision 1713)
@@ -9,6 +9,6 @@
  *  @author George Gusciora, MHPCC
  *
- *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-09-07 19:58:06 $
+ *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-09-08 00:09:06 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -40,5 +40,8 @@
 #include "psString.h"
 #include "psError.h"
-#include "psAbort.h"
+#include "psLogMsg.h"
+
+#include "psSysUtilsErrors.h"
+#define ERRORNAME_PREFIX PS_ERRORNAME_DOMAIN ".psTrace."
 
 static p_psComponent* cRoot = NULL; // The root of the trace component
@@ -107,6 +110,7 @@
     for (i = 0; i < currentNode->n; i++) {
         if (NULL == currentNode->subcomp[i]) {
-            psError(__func__,
-                    "Sub-component %d of node %s in the trace tree is NULL.\n", i, currentNode->name);
+            psLogMsg(ERRORNAME_PREFIX "p_psTraceReset", PS_LOG_WARN,
+                     PS_ERRORTEXT_psTrace_NULL_SUBCOMPONENT,
+                     i, currentNode->name);
         } else {
             p_psTraceReset(currentNode->subcomp[i]);
@@ -131,5 +135,5 @@
 to ANSI-C.
  *****************************************************************************/
-static void componentAdd(const char *addNodeName, int level)
+static bool componentAdd(const char *addNodeName, int level)
 {
     int i = 0;                  // Loop index variable.
@@ -142,5 +146,7 @@
     // XXX: Verify that this is the correct behavior.
     if (strcmp("", addNodeName) == 0) {
-        psAbort(__func__, "Failed to add null component to trace tree.\n");
+        psErrorMsg(ERRORNAME_PREFIX "componentAdd",PS_ERR_BAD_PARAMETER_NULL,true,
+                   PS_ERRORTEXT_psTrace_ADD_NULL_COMPONENT);
+        return false;
     }
 
@@ -148,10 +154,12 @@
     if (strcmp(".", addNodeName) == 0) {
         cRoot->level = level;
-        return;
+        return true;
     }
 
     if (addNodeName[0] != '.') {
-        psAbort(__func__,"Failed to add %s to the root component tree.\n",
-                addNodeName);
+        psErrorMsg(ERRORNAME_PREFIX "componentAdd",PS_ERR_BAD_PARAMETER_VALUE,true,
+                   PS_ERRORTEXT_psTrace_MALFORMED_COMPONENT_NAME,
+                   addNodeName);
+        return false;
     }
 
@@ -188,4 +196,6 @@
         }
     }
+
+    return true;
 }
 
@@ -201,6 +211,6 @@
  zero
 *****************************************************************************/
-int psTraceSetLevel(const char *comp,   // component of interest
-                    int level)  // desired trace level
+bool psTraceSetLevel(const char *comp,   // component of interest
+                     int level)  // desired trace level
 {
     // If the root component tree does not exist, then initialize it.
@@ -209,8 +219,11 @@
     }
     // Add the new component to the component tree.
-    componentAdd(comp, level);
-
+    if ( !componentAdd(comp, level) ) {
+        psErrorMsg(ERRORNAME_PREFIX "psTraceSetLevel", PS_ERR_UNKNOWN, false,
+                   PS_ERRORTEXT_psTrace_FAILED_TO_ADD_COMPONENT,level,comp);
+        return false;
+    }
     // return 0 on success.
-    return 0;
+    return true;
 }
 
@@ -255,6 +268,7 @@
         for (i = 0; i < currentNode->n; i++) {
             if (NULL == currentNode->subcomp[i]) {
-                psError(__func__,
-                        "Sub-component %d of node %s in trace tree is NULL.\n", i, currentNode->name);
+                psLogMsg(ERRORNAME_PREFIX "p_psTraceReset", PS_LOG_WARN,
+                         PS_ERRORTEXT_psTrace_NULL_SUBCOMPONENT,
+                         i, currentNode->name);
             }
 
@@ -365,5 +379,8 @@
 
     if (NULL == comp) {
-        psError(__func__, "p_psTrace() called on a NULL trace level tree\n");
+        psErrorMsg(ERRORNAME_PREFIX "psTrace", PS_ERR_BAD_PARAMETER_NULL, true,
+                   PS_ERRORTEXT_psTrace_NULL_TRACETREE,
+                   __func__);
+        return;
     }
     // Only display this message if it's trace level is less than the level
