Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Document another public value, don't document in doxygen the private ones (ie, mask...
[simgrid.git] / include / xbt / log.h
index 9bb6e77..207016b 100644 (file)
@@ -25,8 +25,8 @@
  * The different existing priorities.
 */
 typedef enum {
-  xbt_log_priority_none          = 0,  /**< used internally (don't poke with) */
-  xbt_log_priority_trace         = 1, 
+  xbt_log_priority_none          = 0,  /* used internally (don't poke with) */
+  xbt_log_priority_trace         = 1,  /**< enter and return of some functions */
   xbt_log_priority_debug         = 2,  /**< crufty output  */
   xbt_log_priority_verbose       = 3,  /**< verbose output for the user wanting more */
   xbt_log_priority_info          = 4,  /**< output about the regular functionning */
@@ -36,7 +36,7 @@ typedef enum {
 
   xbt_log_priority_infinite      = 8,  /**< value for XBT_LOG_STATIC_THRESHOLD to not log */
 
-  xbt_log_priority_uninitialized = -1  /**< used internally (don't poke with) */
+  xbt_log_priority_uninitialized = -1  /* used internally (don't poke with) */
 } e_xbt_log_priority_t;
              
 
@@ -74,6 +74,16 @@ typedef enum {
 /* The root of the category hierarchy. */
 #define XBT_LOG_ROOT_CAT   root
 
+/* XBT_LOG_NEW_SUBCATEGORY_helper:
+ * Implementation of XBT_LOG_NEW_SUBCATEGORY, which must declare "extern parent" in addition
+ * to avoid an extra declaration of root when XBT_LOG_NEW_SUBCATEGORY is called by
+ * XBT_LOG_NEW_CATEGORY */
+#define XBT_LOG_NEW_SUBCATEGORY_helper(catName, parent, desc) \
+    s_xbt_log_category_t _XBT_LOGV(catName) = {       \
+        &_XBT_LOGV(parent), 0, 0,                    \
+        #catName, xbt_log_priority_uninitialized, 1, \
+        0, 1                                          \
+    }
 /**
  * \ingroup XBT_log
  * \param catName name of new category
@@ -82,13 +92,9 @@ typedef enum {
  *
  * Defines a new subcategory of the parent. 
  */
-#define XBT_LOG_NEW_SUBCATEGORY(catName, parent, desc) \
-    extern s_xbt_log_category_t _XBT_LOGV(parent);    \
-    s_xbt_log_category_t _XBT_LOGV(catName) = {       \
-        &_XBT_LOGV(parent), 0, 0,                    \
-        #catName, xbt_log_priority_uninitialized, 1, \
-        0, 1                                          \
-    }
+#define XBT_LOG_NEW_SUBCATEGORY(catName, parent, desc)    \
+    extern s_xbt_log_category_t _XBT_LOGV(parent);        \
+    XBT_LOG_NEW_SUBCATEGORY_helper(catName, parent, desc) \
 
 /**
  * \ingroup XBT_log  
@@ -97,7 +103,7 @@ typedef enum {
  *
  * Creates a new subcategory of the root category.
  */
-#define XBT_LOG_NEW_CATEGORY(catName,desc)  XBT_LOG_NEW_SUBCATEGORY(catName, XBT_LOG_ROOT_CAT, desc)
+#define XBT_LOG_NEW_CATEGORY(catName,desc)  XBT_LOG_NEW_SUBCATEGORY_helper(catName, XBT_LOG_ROOT_CAT, desc)
 
 /**
  * \ingroup XBT_log