Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remember the description for log categories.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Wed, 28 Mar 2012 13:52:14 +0000 (15:52 +0200)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Wed, 28 Mar 2012 14:07:38 +0000 (16:07 +0200)
include/xbt/log.h
src/xbt/log.c

index 3b77db3..699acd1 100644 (file)
@@ -139,6 +139,7 @@ typedef enum {
         NULL /* firstChild */,                          \
        NULL /* nextSibling */,                         \
         #catName,                                       \
         NULL /* firstChild */,                          \
        NULL /* nextSibling */,                         \
         #catName,                                       \
+        desc,                                           \
         0 /*initialized */,                             \
         xbt_log_priority_uninitialized /* threshold */, \
         1 /* isThreshInherited */,                      \
         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;
   xbt_log_category_t firstChild;
   xbt_log_category_t nextSibling;
   const char *name;
+  const char *description;
   int initialized;
   int threshold;
   int isThreshInherited;
   int initialized;
   int threshold;
   int isThreshInherited;
index 2b4f6e2..eb24a16 100644 (file)
@@ -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 */ ,
 
 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 */ ,
       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);
     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);
   }
 
     xbt_log_help_categories_rec(cat->firstChild, child_prefix);
   }