IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 8244


Ignore:
Timestamp:
Aug 8, 2006, 4:01:02 PM (20 years ago)
Author:
jhoblitt
Message:

change psTrace() to include FILE, LINE, & func
change p_psTrace() to accept file, line, & function arguments
change p_psTrace() to concatenate the calling function name to the end of the facility name

Location:
trunk/psLib/src/sys
Files:
2 edited

Legend:

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

    r8232 r8244  
    99 *  @author GLG, MHPCC
    1010 *
    11  *  @version $Revision: 1.65 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2006-08-08 23:32:23 $
     11 *  @version $Revision: 1.66 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2006-08-09 02:01:02 $
    1313 *
    1414 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    615615 null
    616616 *****************************************************************************/
    617 void p_psTrace(const char *comp,        // component being traced
    618                int level,               // desired trace level
    619                const char *format,
    620                ...)                     // arguments
    621 {
     617void p_psTrace(
     618    const char* file,                  ///< file name
     619    int lineno,                        ///< line number in file
     620    const char* func,                  ///< function name
     621    const char *facil,                 ///< facilty of interest
     622    psS32 level,                       ///< desired trace level
     623    const char *format,                ///< printf-style format command
     624    ...                                ///< trace message arguments
     625)
     626{
     627    // XXX file & lineo are currently unused
    622628    va_list ap;
    623629    va_start(ap, format);
    624630    //    format = va_arg(ap, char *);
    625     psTraceV(comp, level, format, ap);
     631    psString fullFacil = NULL;
     632    psStringAppend(&fullFacil, "%s.%s", facil, func);
     633    psTraceV(fullFacil, level, format, ap);
     634    psFree(fullFacil);
    626635    va_end(ap);
    627636    // fflush(traceFP);
  • trunk/psLib/src/sys/psTrace.h

    r7866 r8244  
    99 *  @author GLG, MHPCC
    1010 *
    11  *  @version $Revision: 1.44 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2006-07-12 02:54:01 $
     11 *  @version $Revision: 1.45 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2006-08-09 02:01:02 $
    1313 *
    1414 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    9191/// Send a trace message
    9292void p_psTrace(
     93    const char* file,                  ///< file name
     94    int lineno,                        ///< line number in file
     95    const char* func,                  ///< function name
    9396    const char *facil,                 ///< facilty of interest
    94     psS32 myLevel,                     ///< desired trace level
     97    psS32 level,                       ///< desired trace level
    9598    const char *format,                ///< printf-style format command
    9699    ...                                ///< trace message arguments
     
    98101
    99102#ifndef SWIG
    100 #define psTrace(facil, level, ...) p_psTrace(facil, level, __VA_ARGS__)
     103#define psTrace(facil, level, ...) p_psTrace(__FILE__,__LINE__,__func__,facil, level, __VA_ARGS__)
    101104/** Sends a trace message. */
    102105void psTraceV(
     
    128131);
    129132
    130 /// Set all trace levels to zero (do not free nodes in the component tree).
     133/// Set all trace levels to zero (do not free nodes in the facility tree).
    131134void psTraceReset();
    132135
Note: See TracChangeset for help on using the changeset viewer.