summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/util/debug.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/util/debug.c b/lib/util/debug.c
index cc57ba8419..a6388513c7 100644
--- a/lib/util/debug.c
+++ b/lib/util/debug.c
@@ -944,14 +944,19 @@ bool dbghdrclass(int level, int cls, const char *location, const char *func)
* not yet loaded, then default to timestamps on.
*/
if( state.settings.timestamp_logs || state.settings.debug_prefix_timestamp) {
+ bool verbose = false;
char header_str[200];
header_str[0] = '\0';
- if( state.settings.debug_pid)
+ if (unlikely(DEBUGLEVEL_CLASS[ cls ] >= 10)) {
+ verbose = true;
+ }
+
+ if (verbose || state.settings.debug_pid)
slprintf(header_str,sizeof(header_str)-1,", pid=%u",(unsigned int)getpid());
- if( state.settings.debug_uid) {
+ if (verbose || state.settings.debug_uid) {
size_t hs_len = strlen(header_str);
slprintf(header_str + hs_len,
sizeof(header_str) - 1 - hs_len,
@@ -960,7 +965,8 @@ 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 ((verbose || 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,