- Define new debug statements
authorBart Polot <bart@net.in.tum.de>
Wed, 1 Feb 2012 17:38:19 +0000 (17:38 +0000)
committerBart Polot <bart@net.in.tum.de>
Wed, 1 Feb 2012 17:38:19 +0000 (17:38 +0000)
src/mesh/gnunet-service-mesh.c
src/mesh/mesh_api.c

index 5abead3144897763d72f76b342e65e84fe263c2e..744f5d2d29253d704a49a74a36ca21d4504c7d4b 100644 (file)
 
 #define MESH_DEBUG_DHT GNUNET_NO
 
+#if MESH_DEBUG
+#define DEBUG(...) GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, __VA_ARGS__)
+#else
+#define DEBUG(...)
+#endif
 
+#if MESH_DEBUG_DHT
+#define DEBUG_DHT(...) GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, __VA_ARGS__)
+#else
+#define DEBUG_DHT(...)
+#endif
 
 /******************************************************************************/
 /************************      DATA STRUCTURES     ****************************/
@@ -477,7 +487,7 @@ mesh_debug (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
   {
     return;
   }
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "MESH: %s\n", s);
+  DEBUG ("MESH: %s\n", s);
 }
 #endif
 
index 4b16b004b5e30917a21af52a1f9c9762fe9c26ab..170572f13f018efe123d6b434698fb839f0754b9 100644 (file)
@@ -47,7 +47,11 @@ extern "C"
 
 #define MESH_API_DEBUG GNUNET_YES
 
+#if MESH_API_DEBUG
 #define LOG(kind,...) GNUNET_log_from (kind, "mesh-api",__VA_ARGS__)
+#else
+#define LOG(kind,...)
+#endif
 
 /******************************************************************************/
 /************************      DATA STRUCTURES     ****************************/