X-Git-Url: https://git.distorted.org.uk/~mdw/disorder/blobdiff_plain/c9467b7a34160c4e25580a2dc82087c5ae0bb2d0..27d60779b713a71805843199e70cf75a6b50b807:/lib/log.c?ds=sidebyside 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)