]> www.vanbest.org Git - sasc-ng.git/commitdiff
no timestamp in log of testing tools
authorleslie <unknown>
Sun, 27 Jan 2008 21:11:05 +0000 (22:11 +0100)
committerleslie <unknown>
Sun, 27 Jan 2008 21:11:05 +0000 (22:11 +0100)
log.c
log.h
testing/compat.c

diff --git a/log.c b/log.c
index 34cc4b5e4f41c729b41884f919d94dcb5f9ce120..6176256b0f974a9b9f8a2cbe26fafa8af05dec95 100644 (file)
--- a/log.c
+++ b/log.c
@@ -32,7 +32,7 @@
 #define LMOD_CFG_VALID  0x80000000
 
 struct LogConfig logcfg = {
-  1,0,0,0,
+  1,0,0,0,0,
   0,
   "/var/log/vdr-sc"
   };
@@ -88,9 +88,12 @@ bool cLogging::GetHeader(int c, struct LogHeader *lh)
 {
   const struct LogModule *lm=GetModule(c);
   if(lm) {
-    time_t tt=time(0);
-    struct tm tm_r;
-    strftime(lh->stamp,sizeof(lh->stamp),"%b %e %T",localtime_r(&tt,&tm_r));
+    if(!logcfg.noTimestamp) {
+      time_t tt=time(0);
+      struct tm tm_r;
+      strftime(lh->stamp,sizeof(lh->stamp),"%b %e %T",localtime_r(&tt,&tm_r));
+      }
+    else lh->stamp[0]=0;
     int i, o=LOPT(c)&~LMOD_ENABLE;
     for(i=0; i<LOPT_NUM; i++,o>>=1) if(o&1) break;
     snprintf(lh->tag,sizeof(lh->tag),"%s.%s",lm->Name,(i>=1 && i<LOPT_NUM && lm->OptName[i-1])?lm->OptName[i-1]:"unknown");
diff --git a/log.h b/log.h
index 87b5184e67fea68e6c291fbb7a18c8ecf2fa4b88..32880e3932213fe1b965e8aa22aa6063d93b03d2 100644 (file)
--- a/log.h
+++ b/log.h
@@ -70,7 +70,7 @@ class cMutex;
 // ----------------------------------------------------------------
 
 struct LogConfig {
-  int logCon, logFile, logSys, logUser;
+  int logCon, logFile, logSys, logUser, noTimestamp;
   int maxFilesize;
   char logFilename[128];
   };
index 1f8a2f7d47583649098e9e3b61e5ff7eb6a84d17..ed9e58d71d1c8fc024dd74da6e1b7009dc1e5cd1 100644 (file)
@@ -48,6 +48,7 @@ bool DllsLoad(const char *libdir)
 void InitAll(const char *cfgdir)
 {
   logcfg.logCon=1;
+  logcfg.noTimestamp=1;
   cSystems::ConfigParse("Cardclient.Immediate","0");
 
   filemaps.SetCfgDir(cfgdir);