summaryrefslogtreecommitdiffstats
path: root/runtime/debug.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2013-02-27 17:38:36 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2013-02-27 17:38:36 +0100
commit84d9283b9fc3492654d637a3941f4dde6c9d46e7 (patch)
tree846096a414c160991935ce73fd647ae63e371adc /runtime/debug.c
parent14efde3492026d0a37f2e89736772ec884e3ae2d (diff)
parent8700672c769084dea7d85158f497e3b9a9942c12 (diff)
downloadrsyslog-84d9283b9fc3492654d637a3941f4dde6c9d46e7.tar.gz
rsyslog-84d9283b9fc3492654d637a3941f4dde6c9d46e7.tar.bz2
rsyslog-84d9283b9fc3492654d637a3941f4dde6c9d46e7.zip
Merge branch 'master' into master-omjournal
Diffstat (limited to 'runtime/debug.c')
-rw-r--r--runtime/debug.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/runtime/debug.c b/runtime/debug.c
index fa39e7fe..1f22d34e 100644
--- a/runtime/debug.c
+++ b/runtime/debug.c
@@ -1398,6 +1398,25 @@ dbgGetRuntimeOptions(void)
}
+void
+dbgSetDebugLevel(int level)
+{
+ Debug = level;
+ debugging_on = (level == DEBUG_FULL) ? 1 : 0;
+}
+
+void
+dbgSetDebugFile(uchar *fn)
+{
+ if(altdbg != -1) {
+ dbgprintf("switching to debug file %s\n", fn);
+ close(altdbg);
+ }
+ if((altdbg = open((char*)fn, O_WRONLY|O_CREAT|O_TRUNC|O_NOCTTY|O_CLOEXEC, S_IRUSR|S_IWUSR)) == -1) {
+ fprintf(stderr, "alternate debug file could not be opened, ignoring. Error: %s\n", strerror(errno));
+ }
+}
+
/* end support system to set debug options at runtime */
rsRetVal dbgClassInit(void)