Changeset 8600 for trunk/psLib/src/sys/psTrace.c
- Timestamp:
- Aug 25, 2006, 12:00:54 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/sys/psTrace.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/sys/psTrace.c
r8577 r8600 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.7 6$ $Name: not supported by cvs2svn $12 * @date $Date: 2006-08-25 00:03:35$11 * @version $Revision: 1.77 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2006-08-25 22:00:54 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 593 593 594 594 if (traceMsg) { 595 // calculate the length of the formatted string596 // XXX this may or may not be a performance issue597 char line[MAX_TRACE_LENGTH];598 599 595 // We indent each message one space for each level of the message. 600 596 for (int i = 0; i < level; i++) { 601 597 write (traceFD, " ", 1); 602 598 } 603 vsnprintf(&line[0], MAX_TRACE_LENGTH, format, ap); 599 psString line = NULL; // Line to print 600 psStringAppendV(&line, format, ap); 604 601 write (traceFD, line, strlen(line)); 605 602 if (line[strlen(line) - 1] != '\n') { … … 647 644 // Append the function name to the facility 648 645 size_t facilLength = strlen(facil); // Length of facility name 649 char fullFacil[MAX_HEADER_LENGTH]; // Full facility name is the facility + the function name 650 strncpy(&fullFacil[0], facil, MAX_HEADER_LENGTH); 651 if (facilLength + 1 < MAX_HEADER_LENGTH) { 652 fullFacil[facilLength] = '.'; 653 strncpy(&fullFacil[facilLength + 1], func, MAX_HEADER_LENGTH - facilLength - 1); 654 } 646 size_t funcLength = strlen(func); // Length of function name 647 char fullFacil[facilLength + funcLength + 2]; // Full facility name is the facility + the function name 648 strcpy(&fullFacil[0], facil); 649 fullFacil[facilLength] = '.'; 650 strcpy(&fullFacil[facilLength + 1], func); 655 651 656 652 va_list ap;
Note:
See TracChangeset
for help on using the changeset viewer.
