diff options
author | Michael Adam <obnox@samba.org> | 2007-09-30 08:07:06 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:31:05 -0500 |
commit | b6a6fbd49309630e00983f9c2e654b805336ffae (patch) | |
tree | 93cc38035a39dea6213d41c09e78fcb1697b2521 /source3/lib | |
parent | f3cf737ff0412ef8faf40a02e8e99c8ce8a271ff (diff) | |
download | samba-b6a6fbd49309630e00983f9c2e654b805336ffae.tar.gz samba-b6a6fbd49309630e00983f9c2e654b805336ffae.tar.bz2 samba-b6a6fbd49309630e00983f9c2e654b805336ffae.zip |
r25434: Add the option to print the debug class (DBGC_CLASS) in the debug header.
Control this by a new boolean smb.conf option "debug class" which is
by default set to "no" to keep the default debug header unchanged.
Michael
Note: You need to make clean for this patch.
(This used to be commit 066a46ba91ca734d9e20cb9d6db36fec209a27d7)
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/debug.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/source3/lib/debug.c b/source3/lib/debug.c index fc7b1d67f6..69da08be77 100644 --- a/source3/lib/debug.c +++ b/source3/lib/debug.c @@ -913,6 +913,7 @@ void dbgflush( void ) Input: level - Debug level of the message (not the system-wide debug level. ) + cls - Debuglevel class of the calling module. file - Pointer to a string containing the name of the file from which this function was called, or an empty string if the __FILE__ macro is not implemented. @@ -930,7 +931,7 @@ void dbgflush( void ) ****************************************************************************/ -BOOL dbghdr( int level, const char *file, const char *func, int line ) +BOOL dbghdr(int level, int cls, const char *file, const char *func, int line) { /* Ensure we don't lose any real errno value. */ int old_errno = errno; @@ -976,6 +977,14 @@ BOOL dbghdr( int level, const char *file, const char *func, int line ) (unsigned int)geteuid(), (unsigned int)getegid(), (unsigned int)getuid(), (unsigned int)getgid()); } + + if (lp_debug_class() && (cls != DBGC_ALL)) { + size_t hs_len = strlen(header_str); + slprintf(header_str + hs_len, + sizeof(header_str) -1 - hs_len, + ", class=%s", + default_classname_table[cls]); + } /* Print it all out at once to prevent split syslog output. */ if( lp_debug_prefix_timestamp() ) { |