From 79657f3133fab3b64c004be3307a853dd1c4a630 Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Wed, 1 Feb 2012 17:38:19 +0000 Subject: [PATCH] - Define new debug statements --- src/mesh/gnunet-service-mesh.c | 12 +++++++++++- src/mesh/mesh_api.c | 4 ++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c index 5abead314..744f5d2d2 100644 --- a/src/mesh/gnunet-service-mesh.c +++ b/src/mesh/gnunet-service-mesh.c @@ -73,7 +73,17 @@ #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 diff --git a/src/mesh/mesh_api.c b/src/mesh/mesh_api.c index 4b16b004b..170572f13 100644 --- a/src/mesh/mesh_api.c +++ b/src/mesh/mesh_api.c @@ -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 ****************************/ -- 2.25.1