Prefix log messages with PID

This commit is contained in:
Joel Rosdahl 2010-02-24 22:17:53 +01:00
parent 3eb87a8bbf
commit 1e2da1868a

3
util.c
View File

@ -50,6 +50,7 @@ void cc_log(const char *format, ...)
if (!logfile) logfile = fopen(cache_logfile, "a");
if (!logfile) return;
fprintf(logfile, "[%-5d] ", getpid());
va_start(ap, format);
vfprintf(logfile, format, ap);
va_end(ap);
@ -70,7 +71,7 @@ void fatal(const char *format, ...)
va_start(ap, format);
fprintf(logfile, "FATAL: ");
fprintf(logfile, "[%-5d] FATAL: ", getpid());
vfprintf(logfile, format, ap);
fflush(logfile);