diff options
author | Antony Dovgal <tony2001@php.net> | 2009-12-14 09:17:21 +0000 |
---|---|---|
committer | Antony Dovgal <tony2001@php.net> | 2009-12-14 09:17:21 +0000 |
commit | 8037ab007ff7d8cffc8cb3f8edb90144c96e3123 (patch) | |
tree | e32bb28fff470a4a80922e83f9bffc89f3612352 | |
parent | 4a1715b41f1a420d02aed2b1beaab8afc5440dfd (diff) | |
download | php-git-8037ab007ff7d8cffc8cb3f8edb90144c96e3123.tar.gz |
show debugging info onle when log_level is set to 'debug' (patch by Jerome Loyet)
-rw-r--r-- | sapi/fpm/fpm/zlog.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sapi/fpm/fpm/zlog.c b/sapi/fpm/fpm/zlog.c index 9923cc90a5..5aed22a640 100644 --- a/sapi/fpm/fpm/zlog.c +++ b/sapi/fpm/fpm/zlog.c @@ -73,7 +73,11 @@ void zlog(const char *function, int line, int flags, const char *fmt, ...) /* {{ saved_errno = errno; gettimeofday(&tv, 0); len = zlog_print_time(&tv, buf, buf_size); - len += snprintf(buf + len, buf_size - len, " [%s] %s(), line %d: ", level_names[flags & ZLOG_LEVEL_MASK], function, line); + if (zlog_level == ZLOG_DEBUG) { + len += snprintf(buf + len, buf_size - len, " [%s] pid %d, %s(), line %d: ", level_names[flags & ZLOG_LEVEL_MASK], getpid(), function, line); + } else { + len += snprintf(buf + len, buf_size - len, " [%s] ", level_names[flags & ZLOG_LEVEL_MASK]); + } if (len > buf_size - 1) { truncated = 1; |