Author: metze
Date: 2006-01-09 20:30:44 +0000 (Mon, 09 Jan 2006)
New Revision: 12799

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=12799

Log:
print out function and location too

metze
Modified:
   branches/SAMBA_4_0/source/include/debug.h
   branches/SAMBA_4_0/source/lib/debug.c


Changeset:
Modified: branches/SAMBA_4_0/source/include/debug.h
===================================================================
--- branches/SAMBA_4_0/source/include/debug.h   2006-01-09 18:25:06 UTC (rev 
12798)
+++ branches/SAMBA_4_0/source/include/debug.h   2006-01-09 20:30:44 UTC (rev 
12799)
@@ -35,7 +35,7 @@
        void (*log_task_id)(int fd);
 };
 
-void do_debug_header(int level);
+void do_debug_header(int level, const char *location, const char *func);
 void do_debug(const char *, ...) PRINTF_ATTRIBUTE(1,2);
 
 extern int DEBUGLEVEL;
@@ -44,7 +44,7 @@
 #define _DEBUG(level, body, header) do { \
        if (DEBUGLVL(level)) { \
                if (header) { \
-                       do_debug_header(level); \
+                       do_debug_header(level, __location__, __FUNCTION__); \
                } \
                do_debug body; \
        } \

Modified: branches/SAMBA_4_0/source/lib/debug.c
===================================================================
--- branches/SAMBA_4_0/source/lib/debug.c       2006-01-09 18:25:06 UTC (rev 
12798)
+++ branches/SAMBA_4_0/source/lib/debug.c       2006-01-09 20:30:44 UTC (rev 
12799)
@@ -45,9 +45,9 @@
   the backend for debug messages. Note that the DEBUG() macro has already
   ensured that the log level has been met before this is called
 */
-void do_debug_header(int level)
+void do_debug_header(int level, const char *location, const char *func)
 {
-       log_timestring(level);
+       log_timestring(level, location, func);
        log_task_id();
 }
 
@@ -162,7 +162,7 @@
        }
 }
 
-void log_timestring(int level)
+void log_timestring(int level, const char *location, const char *func)
 {
        char *t = NULL;
        char *s = NULL;
@@ -172,7 +172,7 @@
        t = timestring(NULL, time(NULL));
        if (!t) return;
 
-       asprintf(&s, "[%s, %d]\n", t, level);
+       asprintf(&s, "[%s, %d %s:%s()]\n", t, level, location, func);
        talloc_free(t);
        if (!s) return;
 

Reply via email to