From: Richard Kettlewell Date: Sat, 17 Oct 2009 12:37:16 +0000 (+0100) Subject: If including both program name and date in log message, put date first. X-Git-Tag: 5.0~88 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/commitdiff_plain/5bb00bddc726ec1718ac67ae6283f7d5ac81f84a If including both program name and date in log message, put date first. --- diff --git a/lib/log.c b/lib/log.c index 95a89a1..00ec7cd 100644 --- a/lib/log.c +++ b/lib/log.c @@ -123,8 +123,6 @@ static void logfp(int pri, const char *msg, void *user) { * sanely */ const char *p; - if(progname) - fprintf(fp, "%s: ", progname); if(logdate) { char timebuf[64]; struct tm *tm; @@ -132,7 +130,9 @@ static void logfp(int pri, const char *msg, void *user) { tm = localtime(&tv.tv_sec); strftime(timebuf, sizeof timebuf, "%Y-%m-%d %H:%M:%S %Z", tm); fprintf(fp, "%s: ", timebuf); - } + } + if(progname) + fprintf(fp, "%s: ", progname); if(pri <= LOG_ERR) fputs("ERROR: ", fp); else if(pri < LOG_DEBUG)