Skip to content

Commit 8037ab0

Browse files
committed
show debugging info onle when log_level is set to 'debug' (patch by Jerome Loyet)
1 parent 4a1715b commit 8037ab0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

sapi/fpm/fpm/zlog.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,11 @@ void zlog(const char *function, int line, int flags, const char *fmt, ...) /* {{
7373
saved_errno = errno;
7474
gettimeofday(&tv, 0);
7575
len = zlog_print_time(&tv, buf, buf_size);
76-
len += snprintf(buf + len, buf_size - len, " [%s] %s(), line %d: ", level_names[flags & ZLOG_LEVEL_MASK], function, line);
76+
if (zlog_level == ZLOG_DEBUG) {
77+
len += snprintf(buf + len, buf_size - len, " [%s] pid %d, %s(), line %d: ", level_names[flags & ZLOG_LEVEL_MASK], getpid(), function, line);
78+
} else {
79+
len += snprintf(buf + len, buf_size - len, " [%s] ", level_names[flags & ZLOG_LEVEL_MASK]);
80+
}
7781

7882
if (len > buf_size - 1) {
7983
truncated = 1;

0 commit comments

Comments
 (0)