summaryrefslogtreecommitdiff
path: root/lib/util
diff options
context:
space:
mode:
Diffstat (limited to 'lib/util')
-rw-r--r--lib/util/debug.c8
-rw-r--r--lib/util/debug.h11
2 files changed, 18 insertions, 1 deletions
diff --git a/lib/util/debug.c b/lib/util/debug.c
index 76178e2074..996efdff7e 100644
--- a/lib/util/debug.c
+++ b/lib/util/debug.c
@@ -198,6 +198,14 @@ _PUBLIC_ void setup_logging(const char *prog_name, enum debug_logtype new_logtyp
}
/**
+ Just run logging to stdout for this program
+*/
+_PUBLIC_ void setup_logging_stdout(void)
+{
+ setup_logging(NULL, DEBUG_STDOUT);
+}
+
+/**
return a string constant containing n tabs
no more than 10 tabs are returned
*/
diff --git a/lib/util/debug.h b/lib/util/debug.h
index 7518a64e19..f0d16952a9 100644
--- a/lib/util/debug.h
+++ b/lib/util/debug.h
@@ -74,7 +74,11 @@ extern int DEBUGLEVEL;
*/
#define DEBUGTAB(n) do_debug_tab(n)
-/** Possible destinations for the debug log */
+/** Possible destinations for the debug log (in order of precedence -
+ * once set to DEBUG_FILE, it is not possible to reset to DEBUG_STDOUT
+ * for example. This makes it easy to override for debug to stderr on
+ * the command line, as the smb.conf cannot reset it back to
+ * file-based logging */
enum debug_logtype {DEBUG_STDOUT = 0, DEBUG_FILE = 1, DEBUG_STDERR = 2};
/**
@@ -102,6 +106,11 @@ _PUBLIC_ void debug_schedule_reopen_logs(void);
_PUBLIC_ void setup_logging(const char *prog_name, enum debug_logtype new_logtype);
/**
+ Just run logging to stdout for this program
+*/
+_PUBLIC_ void setup_logging_stdout(void);
+
+/**
return a string constant containing n tabs
no more than 10 tabs are returned
*/