summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2010-11-01 18:42:36 +1100
committerAndrew Bartlett <abartlet@samba.org>2010-11-02 04:36:04 +0000
commitdb2a61ab26f8dab5c9b8f27ae25f9b1ca5fe67b4 (patch)
tree45df87f2f68e6c1039be1f0d30789af1a24ad3b5 /source3
parent4aeb608eca3be67498819000f5eea9ad63e9b7f8 (diff)
downloadsamba-db2a61ab26f8dab5c9b8f27ae25f9b1ca5fe67b4.tar.gz
samba-db2a61ab26f8dab5c9b8f27ae25f9b1ca5fe67b4.tar.bz2
samba-db2a61ab26f8dab5c9b8f27ae25f9b1ca5fe67b4.zip
debug Explain the behaviour of setup_logging() more clearly
Diffstat (limited to 'source3')
-rw-r--r--source3/include/debug.h7
-rw-r--r--source3/lib/debug.c6
2 files changed, 11 insertions, 2 deletions
diff --git a/source3/include/debug.h b/source3/include/debug.h
index 6f7baec461..92fa6e6145 100644
--- a/source3/include/debug.h
+++ b/source3/include/debug.h
@@ -248,8 +248,11 @@ extern bool *DEBUGLEVEL_CLASS_ISSET;
/* The following definitions come from lib/debug.c */
-/* Possible destinations for the debug log (in order of precedence,
- * only a higher value will override a lower value */
+/** 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_DEFAULT_STDERR = 0, DEBUG_STDOUT = 1, DEBUG_FILE = 2, DEBUG_STDERR = 3};
void setup_logging(const char *prog_name, enum debug_logtype new_logtype);
diff --git a/source3/lib/debug.c b/source3/lib/debug.c
index 026616babf..f9f4cae000 100644
--- a/source3/lib/debug.c
+++ b/source3/lib/debug.c
@@ -564,6 +564,12 @@ void debug_register_msgs(struct messaging_context *msg_ctx)
/**
control the name of the logfile and whether logging will be to stdout, stderr
or a file, and set up syslog
+
+ new_log indicates the destination for the debug log (an enum 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
*/
void setup_logging(const char *prog_name, enum debug_logtype new_logtype)
{