summaryrefslogtreecommitdiffstats
path: root/runtime/debug.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2013-02-27 17:37:56 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2013-02-27 17:37:56 +0100
commit8700672c769084dea7d85158f497e3b9a9942c12 (patch)
tree14c893f49adafd5bb2744175e83f2c3b129bca21 /runtime/debug.c
parentb58df795a88f6ec87958be93d559c6e4edc76e5d (diff)
downloadrsyslog-8700672c769084dea7d85158f497e3b9a9942c12.tar.gz
rsyslog-8700672c769084dea7d85158f497e3b9a9942c12.tar.bz2
rsyslog-8700672c769084dea7d85158f497e3b9a9942c12.zip
added ability to configure debug system via rsyslog.conf
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)