From: leslie Date: Sun, 27 Jan 2008 21:11:05 +0000 (+0100) Subject: no timestamp in log of testing tools X-Git-Tag: 0.9.0~19 X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=e441d61bd464052c1186771f9b725b85e0cfd81b;p=sasc-ng.git no timestamp in log of testing tools --- diff --git a/log.c b/log.c index 34cc4b5..6176256 100644 --- 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>=1) if(o&1) break; snprintf(lh->tag,sizeof(lh->tag),"%s.%s",lm->Name,(i>=1 && iOptName[i-1])?lm->OptName[i-1]:"unknown"); diff --git a/log.h b/log.h index 87b5184..32880e3 100644 --- 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]; }; diff --git a/testing/compat.c b/testing/compat.c index 1f8a2f7..ed9e58d 100644 --- a/testing/compat.c +++ b/testing/compat.c @@ -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);