Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Allow to declare a log category and not use it right away; add XBT_LOG_EXTERNAL_DEFAU...
[simgrid.git] / include / xbt / log.h
index 45b9772..886345f 100644 (file)
@@ -138,7 +138,7 @@ typedef enum {
 # define XBT_LOG_DEFAULT_CATEGORY(cname)
 #else
 # define XBT_LOG_DEFAULT_CATEGORY(cname) \
-        static xbt_log_category_t _XBT_LOGV(default) = &_XBT_LOGV(cname)
+        static xbt_log_category_t _XBT_LOGV(default) _XBT_GNUC_UNUSED = &_XBT_LOGV(cname) 
 #endif
 
 /**
@@ -180,6 +180,18 @@ typedef enum {
 #define XBT_LOG_EXTERNAL_CATEGORY(cname) \
    extern s_xbt_log_category_t _XBT_LOGV(cname)
 
+/**
+ * \ingroup XBT_log
+ * \param cname name of the cat
+ * \hideinitializer
+ *
+ * Indicates that the default category of this file was declared in another file.
+ */
+
+#define XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(cname) \
+   XBT_LOG_EXTERNAL_CATEGORY(cname);\
+   XBT_LOG_DEFAULT_CATEGORY(cname)
+
 /* Functions you may call */
 
 extern void xbt_log_control_set(const char* cs);
@@ -570,6 +582,7 @@ extern xbt_log_appender_t xbt_log_default_appender;
 #define XBT_IN2(fmt,a,b)     LOG3(xbt_log_priority_trace, ">> begin of %s" fmt, _XBT_FUNCTION, a,b)
 #define XBT_IN3(fmt,a,b,c)   LOG4(xbt_log_priority_trace, ">> begin of %s" fmt, _XBT_FUNCTION, a,b,c)
 #define XBT_IN4(fmt,a,b,c,d) LOG5(xbt_log_priority_trace, ">> begin of %s" fmt, _XBT_FUNCTION, a,b,c,d)
+#define XBT_IN5(fmt,a,b,c,d,e) LOG6(xbt_log_priority_trace, ">> begin of %s" fmt, _XBT_FUNCTION, a,b,c,d,e)
 #define XBT_OUT              LOG1(xbt_log_priority_trace, "<< end of %s",       _XBT_FUNCTION)
 #define XBT_HERE             LOG0(xbt_log_priority_trace, "-- was here")