chiark / gitweb /
logfile: Do not log differently with --nodetach
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 23 Nov 2019 17:52:31 +0000 (17:52 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 30 Dec 2019 13:15:49 +0000 (13:15 +0000)
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 <ijackson@chiark.greenend.org.uk>
log.c

diff --git a/log.c b/log.c
index 67b43350e127bb86de07f994ee0ba854bfebc07e..f3ac0573ddc98f98b42de1fd191175787e3d66db 100644 (file)
--- 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);
     }
 }