IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 6, 2005, 2:15:51 PM (21 years ago)
Author:
drobbin
Message:

Updated/changed psTrace & psLog fxns to use fd (were FILE*) as described in SDRS

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/sys/psTrace.c

    r4944 r4951  
    99 *  @author GLG, MHPCC
    1010 *
    11  *  @version $Revision: 1.56 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2005-09-02 21:32:06 $
     11 *  @version $Revision: 1.57 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2005-09-07 00:15:48 $
    1313 *
    1414 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    245245 zero
    246246*****************************************************************************/
    247 psBool psTraceSetLevel(const char *comp,   // component of interest
    248                        int level)  // desired trace level
     247int psTraceSetLevel(const char *comp,   // component of interest
     248                    int level)  // desired trace level
    249249{
    250250    char *compName = NULL;
     251    int prevLevel = -1;
    251252
    252253    // If the root component tree does not exist, then initialize it.
     
    267268        compName = (char *) comp;
    268269    }
    269 
     270    prevLevel = psTraceGetLevel(compName);
    270271    // Add the new component to the component tree.
    271272    if ( !componentAdd(compName, level) ) {
     
    278279            psFree(compName);
    279280        }
    280         return false;
     281        //        return false;
     282        return -1;
    281283    }
    282284
     
    285287    }
    286288
    287     return true;
     289    //    return true;
     290    return prevLevel;
    288291}
    289292
     
    489492void p_psTrace(const char *comp,        // component being traced
    490493               int level,               // desired trace level
     494               const char *format,
    491495               ...)                     // arguments
    492496{
     
    508512    // of it's associatedcomponent.
    509513    if (level <= psTraceGetLevel(comp)) {
    510         va_start(ap, level);
     514        va_start(ap, format);
    511515
    512516        // The following functions get the variable list of parameters with
     
    517521        // We indent each message one space for each level of the message.
    518522        for (i = 0; i < level; i++) {
    519             fprintf(traceFP, " ");
     523            //            fprintf(traceFP, " ");
     524            fprintf(traceFP, "%s", format);
    520525        }
    521526        vfprintf(traceFP, fmt, ap);
     527        //        vfprintf(traceFP, format, ap);
    522528        va_end(ap);
    523529    }
     
    532538    /*
    533539        bool special;
    534      
     540
    535541        // XXX EAM perhaps return an error?
    536542        if (fp == NULL) {
    537543            return;
    538544        }
    539      
     545
    540546        // cannot close traceFP if one of the special FILE ptrs
    541547        special  = (traceFP == NULL);
     
    543549        special |= (traceFP == stdout);
    544550        special |= (traceFP == stderr);
    545      
     551
    546552        if (!special) {
    547553            fclose (traceFP);
Note: See TracChangeset for help on using the changeset viewer.