summaryrefslogtreecommitdiff
path: root/source4/lib/util/debug.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-10-11 20:44:19 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-10-11 20:44:19 +0200
commit2c4391e95002404fb2e1d09f97541c1ece1da46f (patch)
treebf903d374cfffd8bf868e1ac2ac351621b102f05 /source4/lib/util/debug.c
parenta85f6634853a4cf825d70e07a789e96e1882f376 (diff)
downloadsamba-2c4391e95002404fb2e1d09f97541c1ece1da46f.tar.gz
samba-2c4391e95002404fb2e1d09f97541c1ece1da46f.tar.bz2
samba-2c4391e95002404fb2e1d09f97541c1ece1da46f.zip
Provide the same set of helper functions for DEBUG in Samba 3 and Samba
4, even though the macros are still different. This makes it possible to use object code compiled with one DEBUG() macro from the other sourceX directory.
Diffstat (limited to 'source4/lib/util/debug.c')
-rw-r--r--source4/lib/util/debug.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/source4/lib/util/debug.c b/source4/lib/util/debug.c
index 00dcbfc8bd..b6edb908c7 100644
--- a/source4/lib/util/debug.c
+++ b/source4/lib/util/debug.c
@@ -31,7 +31,9 @@
/**
* this global variable determines what messages are printed
*/
-_PUBLIC_ int DEBUGLEVEL;
+int _debug_level = 0;
+_PUBLIC_ int *debug_level = &_debug_level;
+int *DEBUGLEVEL_CLASS = NULL; /* For samba 3 */
/* the registered mutex handlers */
static struct {
@@ -89,12 +91,19 @@ static void log_timestring(int level, const char *location, const char *func)
the backend for debug messages. Note that the DEBUG() macro has already
ensured that the log level has been met before this is called
*/
-_PUBLIC_ void do_debug_header(int level, const char *location, const char *func)
+_PUBLIC_ void dbghdr(int level, const char *location, const char *func)
{
log_timestring(level, location, func);
log_task_id();
}
+
+_PUBLIC_ void dbghdrclass(int level, int class, const char *location, const char *func)
+{
+ /* Simple wrapper, Samba 4 doesn't do debug classes */
+ dbghdr(level, location, func);
+}
+
/**
the backend for debug messages. Note that the DEBUG() macro has already
ensured that the log level has been met before this is called
@@ -102,7 +111,7 @@ _PUBLIC_ void do_debug_header(int level, const char *location, const char *func)
@note You should never have to call this function directly. Call the DEBUG()
macro instead.
*/
-_PUBLIC_ void do_debug(const char *format, ...)
+_PUBLIC_ void dbgtext(const char *format, ...)
{
va_list ap;
char *s = NULL;