]> git.itanic.dy.fi Git - rrdd/commitdiff
debug.c: Remove indentation from the prints
authorTimo Kokkonen <timo.t.kokkonen@iki.fi>
Tue, 26 Jun 2012 13:33:14 +0000 (16:33 +0300)
committerTimo Kokkonen <timo.t.kokkonen@iki.fi>
Tue, 26 Jun 2012 13:33:14 +0000 (16:33 +0300)
The child-depth indentation is not really that useful. In fact, it
makes actually harder to read similar debug print lines with different
indentation. The numerical level of the child generation gives
sufficient information.

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

diff --git a/debug.c b/debug.c
index c139080a18fa743d9563334ec7435b0f8d7cfc41..8f98649b013de599df618146a0b0ab46ef1cf588 100644 (file)
--- a/debug.c
+++ b/debug.c
@@ -24,7 +24,6 @@ void print_trace(const char *file, int line, int color, int l,
 {
         va_list args;
        time_t t = time(0);
-       char indent[16] = { "               " };
        char time[32];
        char trace[1024];
 
@@ -36,10 +35,9 @@ void print_trace(const char *file, int line, int color, int l,
         va_end(args);
 
        strftime(time, sizeof(time), "%d.%m.%Y %T ", localtime(&t));
-       indent[get_parent_count()] = 0;
 
-       fprintf(stderr, "%s%s %s[%5d.%d] %s:%d %s %s",
-               green_color, time, indent,
+       fprintf(stderr, "%s%s [%5d.%d] %s:%d %s %s",
+               green_color, time,
                getpid(), get_parent_count(),
                file, line, normal_color, trace);
        fflush(stderr);