lib/util/debug: with log level = 10 we should be more verbose
authorStefan Metzmacher <metze@samba.org>
Tue, 15 Nov 2011 20:50:54 +0000 (21:50 +0100)
committerStefan Metzmacher <metze@samba.org>
Tue, 15 Nov 2011 20:56:49 +0000 (21:56 +0100)
log level = 10 already impacts performance, so we can turn on
more details and print the pid, [e][u|g]id and class information.

So it implies "debug pid = yes", "debug uid = yes" and "debug class = yes".

This generates a lot more useful log files.

metze

lib/util/debug.c

index cc57ba8419ea3766e2e6bb1674ad4f347ab25ae3..2812136a210b5eab5ad60494ff5d7602c47e87d6 100644 (file)
@@ -948,10 +948,10 @@ bool dbghdrclass(int level, int cls, const char *location, const char *func)
 
                header_str[0] = '\0';
 
-               if( state.settings.debug_pid)
+               if (level >= 10 && state.settings.debug_pid)
                        slprintf(header_str,sizeof(header_str)-1,", pid=%u",(unsigned int)getpid());
 
-               if( state.settings.debug_uid) {
+               if (level >= 10 && state.settings.debug_uid) {
                        size_t hs_len = strlen(header_str);
                        slprintf(header_str + hs_len,
                        sizeof(header_str) - 1 - hs_len,
@@ -960,7 +960,7 @@ bool dbghdrclass(int level, int cls, const char *location, const char *func)
                                (unsigned int)getuid(), (unsigned int)getgid());
                }
 
-               if (state.settings.debug_class && (cls != DBGC_ALL)) {
+               if (level >= 10 && state.settings.debug_class && (cls != DBGC_ALL)) {
                        size_t hs_len = strlen(header_str);
                        slprintf(header_str + hs_len,
                                 sizeof(header_str) -1 - hs_len,