From a65f3848f8c892b4323f108569897489848ede92 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Wed, 28 Mar 2012 15:52:14 +0200 Subject: [PATCH] Remember the description for log categories. --- include/xbt/log.h | 2 ++ src/xbt/log.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/xbt/log.h b/include/xbt/log.h index 3b77db3737..699acd1b49 100644 --- a/include/xbt/log.h +++ b/include/xbt/log.h @@ -139,6 +139,7 @@ typedef enum { NULL /* firstChild */, \ NULL /* nextSibling */, \ #catName, \ + desc, \ 0 /*initialized */, \ xbt_log_priority_uninitialized /* threshold */, \ 1 /* isThreshInherited */, \ @@ -258,6 +259,7 @@ struct xbt_log_category_s { xbt_log_category_t firstChild; xbt_log_category_t nextSibling; const char *name; + const char *description; int initialized; int threshold; int isThreshInherited; diff --git a/src/xbt/log.c b/src/xbt/log.c index 2b4f6e2847..eb24a16ac0 100644 --- a/src/xbt/log.c +++ b/src/xbt/log.c @@ -507,7 +507,7 @@ const char *xbt_log_priority_names[8] = { s_xbt_log_category_t _XBT_LOGV(XBT_LOG_ROOT_CAT) = { NULL /*parent */ , NULL /* firstChild */ , NULL /* nextSibling */ , - "root", + "root", "The common ancestor for all categories", 0 /*initialized */, xbt_log_priority_uninitialized /* threshold */ , 0 /* isThreshInherited */ , NULL /* appender */ , NULL /* layout */ , @@ -1191,7 +1191,7 @@ static void xbt_log_help_categories_rec(xbt_log_category_t category, if (i == xbt_dynar_length(dynar) - 1 && category->parent) *strrchr(child_prefix, '|') = ' '; cat = xbt_dynar_get_as(dynar, i, xbt_log_category_t); - printf("%s%s\n", this_prefix, cat->name); + printf("%s%s: %s\n", this_prefix, cat->name, cat->description); xbt_log_help_categories_rec(cat->firstChild, child_prefix); } -- 2.20.1