diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2009-11-10 12:50:48 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2009-11-10 12:50:48 +0100 |
commit | 2b5e15d549940c7ace9017eaf40d523e3741c9a2 (patch) | |
tree | bc22cdc468329ab9996c0b8b1bc68348e0160149 /tools | |
parent | 224c3aef8b4d3d95ab2100c3056f2f92c130b220 (diff) | |
download | rsyslog-2b5e15d549940c7ace9017eaf40d523e3741c9a2.tar.gz rsyslog-2b5e15d549940c7ace9017eaf40d523e3741c9a2.tar.xz rsyslog-2b5e15d549940c7ace9017eaf40d523e3741c9a2.zip |
added a so-called "On Demand Debug" mode
in which debug output can be generated only after the process has started,
but not right from the beginning. This is assumed to be useful for
hard-to-find bugs. Also improved the doc on the debug system.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/syslogd.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/tools/syslogd.c b/tools/syslogd.c index fb3294d5..7649d054 100644 --- a/tools/syslogd.c +++ b/tools/syslogd.c @@ -1469,13 +1469,27 @@ doFlushRptdMsgs(void) static void debug_switch() { + time_t tTime; + struct tm tp; struct sigaction sigAct; + time(&tTime); + localtime_r(&tTime, &tp); if(debugging_on == 0) { debugging_on = 1; - DBGPRINTF("Switching debugging_on to true\n"); + dbgprintf("\n"); + dbgprintf("\n"); + dbgprintf("********************************************************************************\n"); + dbgprintf("Switching debugging_on to true at %2.2d:%2.2d:%2.2d\n", + tp.tm_hour, tp.tm_min, tp.tm_sec); + dbgprintf("********************************************************************************\n"); } else { - DBGPRINTF("Switching debugging_on to false\n"); + dbgprintf("********************************************************************************\n"); + dbgprintf("Switching debugging_on to false at %2.2d:%2.2d:%2.2d\n", + tp.tm_hour, tp.tm_min, tp.tm_sec); + dbgprintf("********************************************************************************\n"); + dbgprintf("\n"); + dbgprintf("\n"); debugging_on = 0; } @@ -3082,8 +3096,6 @@ doGlblProcessInit(void) fputs(" Already running.\n", stderr); exit(1); /* "good" exit, done if syslogd is already running */ } - } else { - debugging_on = 1; } /* tuck my process id away */ |