From: Ian Jackson Date: Sat, 23 Nov 2019 17:52:31 +0000 (+0000) Subject: logfile: Do not log differently with --nodetach X-Git-Tag: v0.6.0~244 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=f4d23a6b26014ecf606dcc574e5536b8c3798c03;p=secnet.git logfile: Do not log differently with --nodetach This is actually quite anoying. There is no good reason for leaving off the timestamps in tests, or manual debugging, etc. If at some point we want to support running under some kind of log-capturing daemon supervisor which timestamps everything, we can easily make this conditional again. Signed-off-by: Ian Jackson --- diff --git a/log.c b/log.c index 67b4335..f3ac057 100644 --- a/log.c +++ b/log.c @@ -330,22 +330,16 @@ static void logfile_vlog(void *sst, int class, const char *message, pidbuf[0]=0; } - if (secnet_is_daemon) { - if (class&st->level) { - t=time(NULL); - tm=localtime(&t); - fprintf(st->f,"%s %2d %02d:%02d:%02d %s", - months[tm->tm_mon],tm->tm_mday,tm->tm_hour,tm->tm_min, - tm->tm_sec, - pidbuf); - vfprintf(st->f,message,args); - fprintf(st->f,"\n"); - fflush(st->f); - } - } else { - if (pidbuf[0]) MessageFallback(class,"%s",pidbuf); - vMessageFallback(class,message,args); - MessageFallback(class,"\n"); + if (class&st->level) { + t=time(NULL); + tm=localtime(&t); + fprintf(st->f,"%s %2d %02d:%02d:%02d %s", + months[tm->tm_mon],tm->tm_mday,tm->tm_hour,tm->tm_min, + tm->tm_sec, + pidbuf); + vfprintf(st->f,message,args); + fprintf(st->f,"\n"); + fflush(st->f); } }