IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 5118


Ignore:
Timestamp:
Sep 23, 2005, 3:33:12 PM (21 years ago)
Author:
drobbin
Message:

Fixed psTrace to allow levels of 10 and higher

Location:
trunk/psLib
Files:
5 edited

Legend:

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

    r5112 r5118  
    99 *  @author GLG, MHPCC
    1010 *
    11  *  @version $Revision: 1.60 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2005-09-23 21:57:12 $
     11 *  @version $Revision: 1.61 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2005-09-24 01:33:12 $
    1313 *
    1414 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    216216            if (pname == NULL) {
    217217                // This is the final component to add.
    218                 currentNode->subcomp[(currentNode->n) - 1] = componentAlloc(firstComponent, level);
     218                currentNode->subcomp[(currentNode->n) - 1] =
     219                    componentAlloc(firstComponent, level);
    219220            } else {
    220221                // We are adding an intermediate component.  The trace level
     
    224225                // static, one-time, type of behavior.
    225226
    226                 currentNode->subcomp[(currentNode->n) - 1] = componentAlloc(firstComponent, PS_DEFAULT_TRACE_LEVEL);
     227                currentNode->subcomp[(currentNode->n) - 1] =
     228                    componentAlloc(firstComponent, PS_DEFAULT_TRACE_LEVEL);
    227229            }
    228230            currentNode = currentNode->subcomp[(currentNode->n) - 1];
     
    514516        gethostname(hostname, 256);
    515517    }
    516     switch (level) {
    517     case PS_LOG_ABORT:
     518
     519    if (level == PS_LOG_ABORT) {
    518520        clevel = 'A';
    519         break;
    520 
    521     case PS_LOG_ERROR:
     521    } else if (level == PS_LOG_ERROR) {
    522522        clevel = 'E';
    523         break;
    524 
    525     case PS_LOG_WARN:
     523    } else if (level == PS_LOG_WARN) {
    526524        clevel = 'W';
    527         break;
    528 
    529     case PS_LOG_INFO:
     525    } else if (level == PS_LOG_INFO) {
    530526        clevel = 'I';
    531         break;
    532 
    533     case 4:
    534     case 5:
    535     case 6:
    536     case 7:
    537     case 8:
    538     case 9:
     527    } else if (level >= 4) {
    539528        clevel = level + '0';
    540         break;
    541 
    542     default:
     529    } else {
    543530        psTrace("utils.logMsg", 2, "Invalid logMsg level: %d (%s)\n", level, format);
    544531        level = (level < 0) ? 0 : 9;
    545532        clevel = level + '0';
    546         break;
    547533    }
    548534
     
    772758    // XXX: If one must at least log error messages, why don't we set logMsg = true here?
    773759    if (!traceMsg) {
    774         psTrace("utils.traceMsg", 1, "You must at least trace error messages (You chose \"%s\")", format);
     760        psTrace("utils.traceMsg", 1,
     761                "You must at least trace error messages (You chose \"%s\")", format);
    775762
    776763    }
  • trunk/psLib/test/mathtypes/tst_psVector.c

    r5114 r5118  
    1414 *  @author  Ross Harman, MHPCC
    1515 *
    16  *  @version $Revision: 1.5 $  $Name: not supported by cvs2svn $
    17  *  @date  $Date: 2005-09-24 00:17:44 $
     16 *  @version $Revision: 1.6 $  $Name: not supported by cvs2svn $
     17 *  @date  $Date: 2005-09-24 01:33:12 $
    1818 *
    1919 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    152152    for(psS32 i = 0; i < 10; i++) {
    153153        if (psVec->data.S32[i] != i*10) {
    154             fprintf(stderr,"Elem %d = %d, expected %d\n", i, psVec->data.S32[i], i*10);
     154            fprintf(stderr,"Elem %d = %d, expected %d\n", i,
     155                    psVec->data.S32[i], i*10);
    155156            return 5;
    156157        }
     
    174175    for(psS32 i = 0; i < 3; i++) {
    175176        if (psVec->data.S32[i] != i*10) {
    176             fprintf(stderr,"Elem %d = %d, expected %d\n", i, psVec->data.S32[i], i*10);
     177            fprintf(stderr,"Elem %d = %d, expected %d\n", i,
     178                    psVec->data.S32[i], i*10);
    177179            return 12;
    178180        }
     
    374376    for (int i = 0; i < 10; i++) {
    375377        if (test->data.S32[i] != i) {
    376             fprintf(stderr, "Vector data does not match. i = %d, data=%d\n", i, test->data.S32[i]);
     378            fprintf(stderr, "Vector data does not match. i = %d, data=%d\n",
     379                    i, test->data.S32[i]);
    377380            return 1;
    378381        }
    379382        if (test2->data.F32[i] != i*0.5) {
    380             fprintf(stderr, "Vector data does not match. i = %d, data=%f\n", i, test->data.F32[i]);
     383            fprintf(stderr, "Vector data does not match. i = %d, data=%f\n",
     384                    i, test->data.F32[i]);
    381385            return 1;
    382386        }
     
    400404        fprintf(stderr, "VectorSet Failed to set S32 at position 1\n");
    401405    if ( (psS32)psVectorGet(vec, 0) != 10 )
    402         fprintf(stderr, "VectorGet Failed to return the correct S32 from position 0\n");
     406        fprintf(stderr,
     407                "VectorGet Failed to return the correct S32 from position 0\n");
    403408    if ( (psS32)psVectorGet(vec, -1) != 4 )
    404         fprintf(stderr, "VectorGet Failed to return the correct S32 from tail using -1\n");
     409        fprintf(stderr,
     410                "VectorGet Failed to return the correct S32 from tail using -1\n");
    405411
    406412    psFree(vec);
  • trunk/psLib/test/sys/tst_psTrace.c

    r5112 r5118  
    6969        lev = psTraceGetLevel(".NODE00");
    7070        if (lev != i) {
    71             fprintf(stderr,"ERROR: (.NODE00) expected trace level was %d, actual was %d\n",
     71            fprintf(stderr,
     72                    "ERROR: (.NODE00) expected trace level was %d, actual was %d\n",
    7273                    i, lev);
    7374            return 2;
     
    8889        lev = psTraceGetLevel(".NODE00.NODE01");
    8990        if (lev != i) {
    90             fprintf(stderr,"ERROR: (.NODE00.NODE01) expected trace level was %d, actual was %d\n",
     91            fprintf(stderr,
     92                    "ERROR: (.NODE00.NODE01) expected trace level was %d, actual was %d\n",
    9193                    i, lev);
    9294            return 4;
     
    225227        (void)psTraceSetLevel(".a.b", 7);
    226228        psTrace(".a.b", 5, "(2) This message should be displayed (%x)\n",
     229                0xbeefface);
     230        (void)psTraceSetLevel(".a.b.c", 12);
     231        psTrace(".a.b.c", 11, "(3) This message should be displayed (%x)\n",
    227232                0xbeefface);
    228233
  • trunk/psLib/test/sys/verified/tst_psTrace.stderr

    r5071 r5118  
    6464     (1) This message should be displayed (beefface)
    6565     (2) This message should be displayed (beefface)
     66           (3) This message should be displayed (beefface)
    6667
    6768---> TESTPOINT PASSED (psTrace{psTrace()} | tst_psTrace.c)
  • trunk/psLib/test/sys/verified/tst_psTrace.stdout

    r4547 r5118  
    22     (1) This message should be displayed (beefface)
    33     (2) This message should be displayed (beefface)
     4           (3) This message should be displayed (beefface)
    45.                    9
    56 a                   8
Note: See TracChangeset for help on using the changeset viewer.