src/lib/message.c
static void pt_out(char *buf)
{
    /*
     * Used the "trace on" command in the console to turn on
     *  output to the trace file.  "trace off" will close the file.
     */
    if (trace) {
       if (!trace_fd) {
          char fn[200];
          bsnprintf(fn, sizeof(fn), "%s/%s.trace", working_directory ? working_directory : "./", my_name);
          trace_fd = bfopen(fn, "a+b");
       }
       if (trace_fd) {
          fputs(buf, trace_fd);
          fflush(trace_fd);
          return;
       } else {
          /* Some problem, turn off tracing */
          trace = false;
       }
    }
    /* not tracing */
    fputs(buf, stdout);
    fflush(stdout);
}
/*
 * print or write output to trace file
 */
print or write output to trace file
print or write output to trace file
static void pt_out(char *buf)
{
    if (trace) {
       if (!trace_fd) {
          char fn[200];
          bsnprintf(fn, sizeof(fn), "%s/%s.trace", working_directory ? working_directory : "./", my_name);
          trace_fd = bfopen(fn, "a+b");
       }
       if (trace_fd) {
          fputs(buf, trace_fd);
          fflush(trace_fd);
          return;
       } else {
          trace = false;
       }
    }
    fputs(buf, stdout);
    fflush(stdout);
}
static void pt_out ( char * buf ) { if ( trace ) { if ( ! trace_fd ) { char fn [ 200 ] ; bsnprintf ( fn , sizeof ( fn ) , " " , working_directory ? working_directory : " " , my_name ) ; trace_fd = bfopen ( fn , " " ) ; } if ( trace_fd ) { fputs ( buf , trace_fd ) ; fflush ( trace_fd ) ; return ; } else { trace = false ; } } fputs ( buf , stdout ) ; fflush ( stdout ) ; }
print or write output to trace file
print or write output to trace file
/*
     * Used the "trace on" command in the console to turn on
     *  output to the trace file.  "trace off" will close the file.
     */ /* Some problem, turn off tracing */ /* not tracing */