version 1.7, 2004/12/07 17:10:56 |
version 1.8, 2004/12/15 06:11:40 |
|
|
cvs_log_filters[LP_DEBUG] = 1; |
cvs_log_filters[LP_DEBUG] = 1; |
cvs_log_filters[LP_INFO] = 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) { |
if (dest & LD_SYSLOG) { |
slopt = 0; |
slopt = 0; |
|
|
|
|
if (level > LP_MAX) |
if (level > LP_MAX) |
return (-1); |
return (-1); |
|
|
|
|
/* apply any filters */ |
/* apply any filters */ |
if (cvs_log_filters[level] != 0) |
if (cvs_log_filters[level] != 0) |
return (0); |
return (0); |
|
|
|
|
#ifdef CVS |
#ifdef CVS |
/* The cvs program appends the command name to the program name */ |
/* 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) |
if (level == LP_ABORT) |
snprintf(prefix, sizeof(prefix), "%s [%s aborted]", |
snprintf(prefix, sizeof(prefix), "%s [%s aborted]", |
__progname, cvs_command); |
__progname, cvs_command); |
|
|
#endif |
#endif |
strlcpy(prefix, __progname, sizeof(prefix)); |
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()); |
snprintf(buf, sizeof(buf), "[%d]", (int)getpid()); |
strlcat(prefix, buf, sizeof(prefix)); |
strlcat(prefix, buf, sizeof(prefix)); |
} |
} |
|
|
} |
} |
#endif |
#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) |
if (cvs_log_dest & LD_SYSLOG) |