debug Explain the behaviour of setup_logging() more clearly
authorAndrew Bartlett <abartlet@samba.org>
Mon, 1 Nov 2010 07:42:36 +0000 (18:42 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 2 Nov 2010 04:36:04 +0000 (04:36 +0000)
lib/util/debug.c
source3/include/debug.h
source3/lib/debug.c

index 5760a709ef5772f7cdf4d460a44007bdce3e440e..54e7a5fcf6b9d0833f57f247ee0f76df21f297b4 100644 (file)
@@ -190,7 +190,13 @@ void debug_setup_talloc_log(void)
 
 /**
   control the name of the logfile and whether logging will be to stdout, stderr
-  or a file
+  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
 */
 _PUBLIC_ void setup_logging(const char *prog_name, enum debug_logtype new_logtype)
 {
index 6f7baec4619d291ca652f419e06ed805990729fa..92fa6e61453bbd972180f02eb33eb28e51024abc 100644 (file)
@@ -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);
index 026616babf5e1068d06d05c21c3781d64d1071e8..f9f4cae000b1c7994a57cfd46a8dfae021f23733 100644 (file)
@@ -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)
 {