From 6a03af769a14b1d1a07f6d819574957c216ecc2e Mon Sep 17 00:00:00 2001 From: Lu Guanqun Date: Mon, 8 Aug 2011 10:24:13 +0800 Subject: [PATCH] log: add thread name This patch displays thread name in the log, that would be more descriptive. It improves Xingchao (xingchao.wang@intel.com)'s patch which shows thread id. Signed-off-by: Lu Guanqun --- src/pulsecore/log.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pulsecore/log.c b/src/pulsecore/log.c index 13038148..e2721ac0 100644 --- a/src/pulsecore/log.c +++ b/src/pulsecore/log.c @@ -302,9 +302,9 @@ void pa_log_levelv_meta( pa_vsnprintf(text, sizeof(text), format, ap); if ((_flags & PA_LOG_PRINT_META) && file && line > 0 && func) - pa_snprintf(location, sizeof(location), "[%s:%i %s()] ", file, line, func); + pa_snprintf(location, sizeof(location), "[%s][%s:%i %s()] ", pa_thread_get_name(pa_thread_self()), file, line, func); else if ((_flags & (PA_LOG_PRINT_META|PA_LOG_PRINT_FILE)) && file) - pa_snprintf(location, sizeof(location), "%s: ", pa_path_get_filename(file)); + pa_snprintf(location, sizeof(location), "[%s] %s: ", pa_thread_get_name(pa_thread_self()), pa_path_get_filename(file)); else location[0] = 0; -- 2.39.2