From 6203fb967cf30ccc1234b582019c25be7aac51dd Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 7 May 2020 20:42:52 +0200 Subject: [PATCH] log: make line==0 suppress the file/line/func output Disable file/line/func output for pod debug --- spa/plugins/support/logger.c | 2 +- src/pipewire/log.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spa/plugins/support/logger.c b/spa/plugins/support/logger.c index 91ae2e12b..7d100ce34 100644 --- a/spa/plugins/support/logger.c +++ b/spa/plugins/support/logger.c @@ -106,7 +106,7 @@ impl_log_logv(void *object, now.tv_sec & 0x1FFFFFFF, now.tv_nsec / 1000); } - if (impl->line) { + if (impl->line && line != 0) { size += snprintf(p + size, len - size, "[%s:%i %s()]", strrchr(file, '/') + 1, line, func); } diff --git a/src/pipewire/log.c b/src/pipewire/log.c index 59ffd2f05..9a0bc2a96 100644 --- a/src/pipewire/log.c +++ b/src/pipewire/log.c @@ -332,7 +332,7 @@ void pw_log_log_object(enum spa_log_level level, const char *func, uint32_t flags, const void *object) { - struct log_ctx ctx = { level, file, line, func, }; + struct log_ctx ctx = { level, file, 0, func, }; if (flags & PW_LOG_OBJECT_POD) { const struct spa_pod *pod = object; log_pod_value(&ctx, 0, SPA_TYPE_ROOT,