chiark / gitweb /
If including both program name and date in log message, put date first.
authorRichard Kettlewell <rjk@greenend.org.uk>
Sat, 17 Oct 2009 12:37:16 +0000 (13:37 +0100)
committerRichard Kettlewell <rjk@greenend.org.uk>
Sat, 17 Oct 2009 12:37:16 +0000 (13:37 +0100)
lib/log.c

index 95a89a1..00ec7cd 100644 (file)
--- 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)