Changeset 885 for trunk/psLib/src/sysUtils/psTrace.c
- Timestamp:
- Jun 4, 2004, 3:27:54 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/sysUtils/psTrace.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/sysUtils/psTrace.c
r560 r885 39 39 40 40 static Component *croot = NULL; // The root of the trace component 41 static FILE *traceFP = NULL; 41 42 /***************************************************************************** 42 43 componentAlloc(): allocate memory for a new node, and initialize members. … … 378 379 va_start(ap, level); 379 380 380 // We indent each message one space foe each level of the message.381 for (i = 0; i < level; i++) {382 putchar(' ');383 }384 385 381 // The following functions get the variable list of parameters with 386 382 // which this function was called, and print them to the standard 387 383 // output. 388 384 fmt = va_arg(ap, char *); 389 vprintf(fmt, ap); 385 386 if (traceFP != NULL) { 387 // We indent each message one space for each level of the message. 388 for (i = 0; i < level; i++) { 389 fprintf(traceFP, " "); 390 } 391 vfprintf(traceFP, fmt, ap); 392 } else { 393 // We indent each message one space for each level of the message. 394 for (i = 0; i < level; i++) { 395 putchar(' '); 396 } 397 vprintf(fmt, ap); 398 } 390 399 va_end(ap); 391 400 } … … 393 402 // NOTE: should we free *fmt as well? Read the man page. 394 403 } 404 405 void psTraceSetDestination(FILE *fp) 406 { 407 traceFP = fp; 408 }
Note:
See TracChangeset
for help on using the changeset viewer.
