]> git.itanic.dy.fi Git - rrdd/commitdiff
debug: Remove pid number from debug prints
authorTimo Kokkonen <timo.t.kokkonen@iki.fi>
Sun, 10 Jul 2016 06:28:34 +0000 (09:28 +0300)
committerTimo Kokkonen <timo.t.kokkonen@iki.fi>
Sun, 10 Jul 2016 06:28:34 +0000 (09:28 +0300)
Everything happens now in the same pid name space. Thread numbers
change, but thread names are more descriptive than numbers.

Remove the pid number and put the thread name inside the bracets.

Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
debug.c

diff --git a/debug.c b/debug.c
index 437ce5eb87f02963da2639e1e44b58023b741f16..201f7ef2d1a233cdaa70e877bee2fdaf19448224 100644 (file)
--- a/debug.c
+++ b/debug.c
@@ -60,9 +60,8 @@ void print_trace(const char *file, int line, int color, int l,
        pthread_getname_np(pthread_self(), thread_name, sizeof(thread_name));
 
        ret = snprintf(all_trace, sizeof(all_trace),
        pthread_getname_np(pthread_self(), thread_name, sizeof(thread_name));
 
        ret = snprintf(all_trace, sizeof(all_trace),
-               "%s%s [%5d] %s %s:%d %s %s",
+               "%s%s [%s] %s:%d %s %s",
                color_str, time,
                color_str, time,
-               getpid(),
                thread_name,
                file, line, normal_color, trace);
 
                thread_name,
                file, line, normal_color, trace);