From 09bae654b2c832a3d8d61df1b9a72f99175fb23a Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 23 Nov 2019 17:52:31 +0000 Subject: [PATCH] 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 --- log.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) 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); } } -- 2.30.2