Fix ndrdump to use a common setup_logging() API
[ira/wip.git] / lib / util / debug.h
index 8f4fa2a8fcf8eaa0bd053ac6e67fa0dc678f3e57..f0d16952a987b7d9ad94746730748cd04c9a98b1 100644 (file)
@@ -17,6 +17,9 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#ifndef _SAMBA_DEBUG_H_
+#define _SAMBA_DEBUG_H_
+
 /**
  * @file
  * @brief Debugging macros
@@ -71,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};
 
 /**
@@ -80,6 +87,8 @@ enum debug_logtype {DEBUG_STDOUT = 0, DEBUG_FILE = 1, DEBUG_STDERR = 2};
 */
 _PUBLIC_ void dbghdr(int level, const char *location, const char *func);
 
+_PUBLIC_ void dbghdrclass(int level, int cls, const char *location, const char *func);
+
 /**
   reopen the log file (usually called because the log file name might have changed)
 */
@@ -96,6 +105,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
@@ -127,3 +141,8 @@ _PUBLIC_ void register_debug_handlers(const char *name, struct debug_ops *ops);
   macro instead.
 */
 _PUBLIC_ void dbgtext(const char *format, ...) PRINTF_ATTRIBUTE(1,2);
+
+struct _XFILE;
+extern struct _XFILE *dbf;
+
+#endif