=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/cvs/log.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- src/usr.bin/cvs/log.c 2004/12/07 17:10:56 1.7 +++ src/usr.bin/cvs/log.c 2004/12/15 06:11:40 1.8 @@ -1,4 +1,4 @@ -/* $OpenBSD: log.c,v 1.7 2004/12/07 17:10:56 tedu Exp $ */ +/* $OpenBSD: log.c,v 1.8 2004/12/15 06:11:40 jfb Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. @@ -95,6 +95,9 @@ cvs_log_filters[LP_DEBUG] = 1; cvs_log_filters[LP_INFO] = 1; + /* traces are enabled with the -t command-line option */ + cvs_log_filters[LP_TRACE] = 1; + if (dest & LD_SYSLOG) { slopt = 0; @@ -212,7 +215,6 @@ if (level > LP_MAX) return (-1); - /* apply any filters */ if (cvs_log_filters[level] != 0) return (0); @@ -224,7 +226,11 @@ #ifdef CVS /* The cvs program appends the command name to the program name */ - if (cvs_command != NULL) { + if (level == LP_TRACE) { + strlcpy(prefix, " -> ", sizeof(prefix)); + if (cvs_cmdop == CVS_OP_SERVER) + prefix[0] = 'S'; + } else if (cvs_command != NULL) { if (level == LP_ABORT) snprintf(prefix, sizeof(prefix), "%s [%s aborted]", __progname, cvs_command); @@ -235,7 +241,7 @@ #endif strlcpy(prefix, __progname, sizeof(prefix)); - if (cvs_log_flags & LF_PID) { + if ((cvs_log_flags & LF_PID) && (level != LP_TRACE)) { snprintf(buf, sizeof(buf), "[%d]", (int)getpid()); strlcat(prefix, buf, sizeof(prefix)); } @@ -262,7 +268,11 @@ } #endif - fprintf(out, "%s: %s\n", prefix, buf); + fputs(prefix, out); + if (level != LP_TRACE) + fputs(": ", out); + fputs(buf, out); + fputc('\n', out); } if (cvs_log_dest & LD_SYSLOG)