]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libsmartcols: improve debug messages
authorKarel Zak <kzak@redhat.com>
Wed, 12 Oct 2022 07:40:43 +0000 (09:40 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 25 Oct 2022 09:11:06 +0000 (11:11 +0200)
* disable debug for tree-wall; it generates to many messages

* fix way how library prints column flags, 0x<hex> is more redable

Signed-off-by: Karel Zak <kzak@redhat.com>
libsmartcols/src/table.c
libsmartcols/src/walk.c

index cab2b455e76e0c412817fdfeb8e28a584c344c49..8449c4fae56d2e956ac459c9b271c34f2f346e80 100644 (file)
@@ -419,7 +419,7 @@ struct libscols_column *scols_table_new_column(struct libscols_table *tb,
        if (!tb)
                return NULL;
 
-       DBG(TAB, ul_debugobj(tb, "new column name=%s, whint=%g, flags=%d",
+       DBG(TAB, ul_debugobj(tb, "new column name=%s, whint=%g, flags=0x%04x",
                                name, whint, flags));
        cl = scols_new_column();
        if (!cl)
index a75fde6a342601f297c3ad0f2519724f1adca063..0b51fed5fc2ffa9506266aa7d2c5ee0c7c1a6b91 100644 (file)
@@ -11,7 +11,7 @@ static int walk_line(struct libscols_table *tb,
 {
        int rc = 0;
 
-       DBG(LINE, ul_debugobj(ln, " wall line"));
+/*     DBG(LINE, ul_debugobj(ln, " wall line")); */
 
        /* we list group children in __scols_print_tree() after tree root node */
        if (is_group_member(ln) && is_last_group_member(ln) && has_group_children(ln))
@@ -26,7 +26,7 @@ static int walk_line(struct libscols_table *tb,
        if (rc == 0 && has_children(ln)) {
                struct list_head *p;
 
-               DBG(LINE, ul_debugobj(ln, " children walk"));
+/*             DBG(LINE, ul_debugobj(ln, " children walk"));*/
 
                list_for_each(p, &ln->ln_branch) {
                        struct libscols_line *chld = list_entry(p,
@@ -38,7 +38,7 @@ static int walk_line(struct libscols_table *tb,
                }
        }
 
-       DBG(LINE, ul_debugobj(ln, "<- walk line done [rc=%d]", rc));
+/*     DBG(LINE, ul_debugobj(ln, "<- walk line done [rc=%d]", rc)); */
        return rc;
 }
 
@@ -90,7 +90,7 @@ int scols_walk_tree(struct libscols_table *tb,
        struct libscols_iter itr;
 
        assert(tb);
-       DBG(TAB, ul_debugobj(tb, ">> walk start"));
+/*     DBG(TAB, ul_debugobj(tb, ">> walk start"));*/
 
        /* init */
        tb->ngrpchlds_pending = 0;
@@ -147,6 +147,6 @@ int scols_walk_tree(struct libscols_table *tb,
 
        tb->ngrpchlds_pending = 0;
        tb->walk_last_done = 0;
-       DBG(TAB, ul_debugobj(tb, "<< walk end [rc=%d]", rc));
+/*     DBG(TAB, ul_debugobj(tb, "<< walk end [rc=%d]", rc));*/
        return rc;
 }