Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt	(revision 1091)
+++ CMakeLists.txt	(revision 1119)
@@ -52,4 +52,7 @@
 SET(CMAKE_C_FLAGS_DEBIANPACKAGE "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
 
+# Set the "Debug" flags
+SET(CMAKE_C_FLAGS_DEBUG "-Wall -g -O0")
+
 # Add a "DebugValgrind" build type used for checking execution with Valgrind tool
 SET(CMAKE_C_FLAGS_DEBUGVALGRIND "-Wall -g -O0")
Index: extensions/app_radgw/rgw_clients.c
===================================================================
--- extensions/app_radgw/rgw_clients.c	(revision 1107)
+++ extensions/app_radgw/rgw_clients.c	(revision 1119)
@@ -976,7 +976,6 @@
 		char sa_buf[sSA_DUMP_STRLEN];
 		client = (struct rgw_client *)ref;
-		/* TODO: use a fct param instead of hardcoded FD_LOG_DEBUG */
-		TODO("Replace with appropriate code");
-/*		TRACE_sSA(FD_LOG_DEBUG, NONE, 	 "  - ", client->sa, NI_NUMERICHOST | NI_NUMERICSERV, (client->type == RGW_CLI_NAS) ? "" : " [PROXY]" ); */
+		fd_sa_sdump_numeric(sa_buf, client->sa);
+		LOG_D("  - %s%s", sa_buf, (client->type == RGW_CLI_NAS) ? "" : " [PROXY]" );
 	}
 }
Index: extensions/app_radgw/rgwx_acct.c
===================================================================
--- extensions/app_radgw/rgwx_acct.c	(revision 1105)
+++ extensions/app_radgw/rgwx_acct.c	(revision 1119)
@@ -1220,6 +1220,9 @@
 out:
 	if (answer && *answer) {
-		TRACE_DEBUG(INFO, "Received the following problematic STA message, discarding anyway...");
-		fd_msg_dump_walk( INFO, *answer );
+		char * buf = NULL; size_t buflen;
+		CHECK_MALLOC_DO( fd_msg_dump_treeview(&buf, &buflen, NULL, *answer, NULL, 0, 1), );
+		TRACE_DEBUG(INFO, "Received the following problematic STA message, discarding anyway: %s", buf ?: "<error>");
+		free(buf);
+		
 		fd_msg_free(*answer);
 		*answer = NULL;
Index: extensions/app_radgw/rgwx_auth.c
===================================================================
--- extensions/app_radgw/rgwx_auth.c	(revision 1088)
+++ extensions/app_radgw/rgwx_auth.c	(revision 1119)
@@ -126,5 +126,5 @@
 
 struct sess_state {
-	char req_auth[16];
+	uint8_t req_auth[16];
 };
 
Index: extensions/app_radgw/rgwx_debug.c
===================================================================
--- extensions/app_radgw/rgwx_debug.c	(revision 996)
+++ extensions/app_radgw/rgwx_debug.c	(revision 1119)
@@ -95,6 +95,8 @@
 		fd_log_debug(" Diameter message: NULL pointer");
 	} else {
-		fd_log_debug(" Diameter message (%p) DUMP:", *diam_fw);
-		fd_msg_dump_walk(0, *diam_fw);
+		char * buf = NULL; size_t buflen;
+		CHECK_MALLOC( fd_msg_dump_treeview(&buf, &buflen, NULL, *diam_fw, NULL, 0, 1) );
+		fd_log_debug(" Diameter message (%p) DUMP: %s", *diam_fw, buf);
+		free(buf);
 	}
 	
@@ -114,6 +116,8 @@
 		fd_log_debug(" Diameter message: NULL pointer");
 	} else {
-		fd_log_debug(" Diameter message (%p) DUMP:", *diam_ans);
-		fd_msg_dump_walk(0, *diam_ans);
+		char * buf = NULL; size_t buflen;
+		CHECK_MALLOC( fd_msg_dump_treeview(&buf, &buflen, NULL, *diam_ans, NULL, 0, 1) );
+		fd_log_debug(" Diameter message (%p) DUMP: %s", *diam_ans, buf);
+		free(buf);
 	}
 	
Index: extensions/app_radgw/rgwx_echodrop.c
===================================================================
--- extensions/app_radgw/rgwx_echodrop.c	(revision 1088)
+++ extensions/app_radgw/rgwx_echodrop.c	(revision 1119)
@@ -62,4 +62,5 @@
 		CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "\n"), return NULL);
 	}
+	return *buf;
 }
 
Index: extensions/app_radgw/rgwx_sip.c
===================================================================
--- extensions/app_radgw/rgwx_sip.c	(revision 1088)
+++ extensions/app_radgw/rgwx_sip.c	(revision 1119)
@@ -723,5 +723,4 @@
 	struct avp_hdr *ahdr;
 	//char buf[254]; /* to store some attributes values (with final '\0') */
-	unsigned char * req_sip = NULL;
 	struct session * sess;
 	os0_t sid = NULL;
Index: extensions/app_sip/locationinfo.c
===================================================================
--- extensions/app_sip/locationinfo.c	(revision 639)
+++ extensions/app_sip/locationinfo.c	(revision 1119)
@@ -201,8 +201,4 @@
 	CHECK_FCT( fd_msg_rescode_set( ans, result, NULL, NULL, 1 ) );
 	
-	//DEBUG
-	fd_msg_dump_walk(INFO,qry);
-	fd_msg_dump_walk(INFO,ans);
-	
 	CHECK_FCT( fd_msg_send( msg, NULL, NULL ));
 	
Index: extensions/dbg_interactive/dbg_interactive.i
===================================================================
--- extensions/dbg_interactive/dbg_interactive.i	(revision 1021)
+++ extensions/dbg_interactive/dbg_interactive.i	(revision 1119)
@@ -152,4 +152,15 @@
 /* Forward declaration for the peers module */
 static void fd_add_cb(struct peer_info *peer, void *data);
+
+/* This one gives problems when included from the header file */
+void fd_log_va( int, const char *, va_list);
+void fd_log_deprecated( int level, const char *format, ... ) MARK_DEPRECATED
+{ 
+	va_list ap;
+	va_start(ap, format);
+	fd_log_va(level, format, ap);
+	va_end(ap);
+}
+
 %}
 
Index: extensions/dbg_rt/dbg_rt.c
===================================================================
--- extensions/dbg_rt/dbg_rt.c	(revision 974)
+++ extensions/dbg_rt/dbg_rt.c	(revision 1119)
@@ -46,10 +46,13 @@
 static int dbgrt_fwd_cb(void * cbdata, struct msg ** msg)
 {
+	char * buf = NULL; size_t buflen;
 	TRACE_ENTRY("%p %p", cbdata, msg);
 	
-	fd_log_debug("[dbg_rt] FWD routing message: %p", msg ? *msg : NULL);
-	if (msg)
-		fd_msg_dump_walk(INFO, *msg);
-	
+	LOG_D("[dbg_rt] FWD routing message: %p", msg ? *msg : NULL);
+	if (msg) {
+		CHECK_MALLOC( fd_msg_dump_treeview(&buf, &buflen, NULL, *msg, NULL, 0, 1) );
+		LOG_D("%s", buf);
+	}
+	free(buf);
 	return 0;
 }
@@ -59,14 +62,16 @@
 {
 	struct fd_list * li;
+	char * buf = NULL; size_t buflen;
 	
 	TRACE_ENTRY("%p %p %p", cbdata, msg, candidates);
 	
-	fd_log_debug("[dbg_rt] OUT routing message: %p", msg);
-	fd_msg_dump_walk(INFO, msg);
-	fd_log_debug("[dbg_rt] Current list of candidates (%p): (score - id)", msg);
+	LOG_D("[dbg_rt] OUT routing message: %p", msg);
+	CHECK_MALLOC( fd_msg_dump_treeview(&buf, &buflen, NULL, msg, NULL, 0, 1) );
+	LOG_D("%s", buf);
+	LOG_D("[dbg_rt] Current list of candidates (%p): (score - id)", msg);
 	
 	for (li = candidates->next; li != candidates; li = li->next) {
 		struct rtd_candidate *c = (struct rtd_candidate *) li;
-		fd_log_debug("[dbg_rt]   %d -\t%s", c->score, c->diamid);
+		LOG_D("[dbg_rt]   %d -\t%s", c->score, c->diamid);
 	}
 	
Index: extensions/test_sip/locationinfo.c
===================================================================
--- extensions/test_sip/locationinfo.c	(revision 924)
+++ extensions/test_sip/locationinfo.c	(revision 1119)
@@ -111,5 +111,4 @@
 	}
 	
-	fd_msg_dump_walk(INFO,message);
 	CHECK_FCT( fd_msg_send( &message, NULL, NULL ));
 	
Index: extensions/test_sip/locationinfosl.c
===================================================================
--- extensions/test_sip/locationinfosl.c	(revision 924)
+++ extensions/test_sip/locationinfosl.c	(revision 1119)
@@ -113,5 +113,4 @@
 	}
 	
-	fd_msg_dump_walk(INFO,message);
 	CHECK_FCT( fd_msg_send( &message, NULL, NULL ));
 	
Index: extensions/test_sip/serverassignment.c
===================================================================
--- extensions/test_sip/serverassignment.c	(revision 924)
+++ extensions/test_sip/serverassignment.c	(revision 1119)
@@ -154,5 +154,4 @@
 	}
 	
-	fd_msg_dump_walk(INFO,message);
 	CHECK_FCT( fd_msg_send( &message, NULL, NULL ));
 	
Index: extensions/test_sip/userauthorization.c
===================================================================
--- extensions/test_sip/userauthorization.c	(revision 924)
+++ extensions/test_sip/userauthorization.c	(revision 1119)
@@ -145,5 +145,4 @@
 	}
 	
-	fd_msg_dump_walk(INFO,message);
 	CHECK_FCT( fd_msg_send( &message, NULL, NULL ));
 	
Index: include/freeDiameter/libfdproto.h
===================================================================
--- include/freeDiameter/libfdproto.h	(revision 1117)
+++ include/freeDiameter/libfdproto.h	(revision 1119)
@@ -147,5 +147,5 @@
 void fd_log ( int, const char *, ... ) _ATTRIBUTE_PRINTFLIKE_(2,3);
 #ifndef SWIG
-void fd_log_va( int, const char *, va_list args );
+void fd_log_va( int, const char *, va_list);
 #endif /* SWIG */
 
@@ -464,4 +464,5 @@
 }
 
+#ifndef SWIG
 static __inline__ void fd_log_deprecated( int level, const char *format, ... ) MARK_DEPRECATED
 { 
@@ -469,6 +470,9 @@
 	va_start(ap, format);
 	fd_log_va(level, format, ap);
-	va_end(ap);	
+	va_end(ap);
 }
+#else /* SWIG */
+void fd_log_deprecated( int level, const char *format, ... );
+#endif /* SWIG */
 static __inline__ void replace_me() MARK_DEPRECATED { }
 
@@ -545,5 +549,5 @@
 	       if ( ! (__bool__) ) {								       \
 		       int __ret__ = EINVAL;							       \
-		       TRACE_ERROR("ERROR: invalid parameter '%s'",  #__bool__ );  	               \
+		       TRACE_ERROR("ERROR: Invalid parameter '%s', %d",  #__bool__, __ret__ );         \
 		       __fallback__;								       \
 	       }										       \
@@ -1231,5 +1235,5 @@
 	dict_avpdata_interpret	 type_interpret;/* cb to convert the AVP value in more comprehensive format (or NULL) */
 	dict_avpdata_encode	 type_encode;	/* cb to convert formatted data into an AVP value (or NULL) */
-	DECLARE_FD_DUMP_PROTOTYPE((*type_dump), union avp_value * val); /* cb called by fd_msg_dump_one for this type of data (if != NULL). Returned string must be freed.  */
+	DECLARE_FD_DUMP_PROTOTYPE((*type_dump), union avp_value * val); /* cb called by fd_msg_dump_* for this type of data (if != NULL). Returned string must be freed.  */
 };
 
Index: libfdcore/config.c
===================================================================
--- libfdcore/config.c	(revision 1113)
+++ libfdcore/config.c	(revision 1119)
@@ -85,5 +85,5 @@
 	FD_DUMP_HANDLE_OFFSET();
 	
-	CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "freeDiameter configuration:\n", fd_g_config), return NULL);	
+	CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "freeDiameter configuration:\n"), return NULL);	
 	CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "  Default trace level .... : %+d\n", fd_g_debug_lvl), return NULL);
 	CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "  Configuration file ..... : %s\n", fd_g_config->cnf_file), return NULL);
Index: libfdcore/core.c
===================================================================
--- libfdcore/core.c	(revision 1112)
+++ libfdcore/core.c	(revision 1119)
@@ -320,5 +320,4 @@
 int fd_core_wait_shutdown_complete(void)
 {
-	int ret;
 	enum core_state cur_state = core_state_get();
 	void * th_ret = NULL;
Index: libfdcore/endpoints.c
===================================================================
--- libfdcore/endpoints.c	(revision 1113)
+++ libfdcore/endpoints.c	(revision 1119)
@@ -328,4 +328,5 @@
 		}
 	}
-}
-	
+	return *buf;
+}
+	
Index: libfdcore/p_ce.c
===================================================================
--- libfdcore/p_ce.c	(revision 1113)
+++ libfdcore/p_ce.c	(revision 1119)
@@ -275,6 +275,5 @@
 		if (hdr->avp_flags & AVP_FLAG_VENDOR) {
 			/* Ignore all vendor-specific AVPs in CER/CEA because we don't support any currently */
-			TRACE_DEBUG(FULL, "Ignored a vendor AVP in CER / CEA");
-			fd_msg_dump_one(FULL, avp);
+			LOG_A("Ignored a vendor-specific AVP in CER / CEA");
 			goto next;
 		}
@@ -284,6 +283,5 @@
 				if (hdr->avp_value == NULL) {
 					/* This is a sanity check */
-					TRACE_DEBUG(NONE, "Ignored an AVP with unset value in CER/CEA");
-					fd_msg_dump_one(NONE, avp);
+					LOG_F("Ignored an AVP (code %x) with unset value in CER/CEA", hdr->avp_code);
 					ASSERT(0); /* To check if this really happens, and understand why... */
 					goto next;
@@ -297,6 +295,5 @@
 				if (hdr->avp_value == NULL) {
 					/* This is a sanity check */
-					TRACE_DEBUG(NONE, "Ignored an AVP with unset value in CER/CEA");
-					fd_msg_dump_one(NONE, avp);
+					LOG_F("Ignored an AVP (code %x) with unset value in CER/CEA", hdr->avp_code);
 					ASSERT(0); /* To check if this really happens, and understand why... */
 					goto next;
@@ -319,6 +316,5 @@
 				if (hdr->avp_value == NULL) {
 					/* This is a sanity check */
-					TRACE_DEBUG(NONE, "Ignored an AVP with unset value in CER/CEA");
-					fd_msg_dump_one(NONE, avp);
+					LOG_F("Ignored an AVP (code %x) with unset value in CER/CEA", hdr->avp_code);
 					ASSERT(0); /* To check if this really happens, and understand why... */
 					goto next;
@@ -350,6 +346,5 @@
 				if (hdr->avp_value == NULL) {
 					/* This is a sanity check */
-					TRACE_DEBUG(NONE, "Ignored an AVP with unset value in CER/CEA");
-					fd_msg_dump_one(NONE, avp);
+					LOG_F("Ignored an AVP (code %x) with unset value in CER/CEA", hdr->avp_code);
 					ASSERT(0); /* To check if this really happens, and understand why... */
 					goto next;
@@ -376,6 +371,5 @@
 				if (hdr->avp_value == NULL) {
 					/* This is a sanity check */
-					TRACE_DEBUG(NONE, "Ignored an AVP with unset value in CER/CEA");
-					fd_msg_dump_one(NONE, avp);
+					LOG_F("Ignored an AVP (code %x) with unset value in CER/CEA", hdr->avp_code);
 					ASSERT(0); /* To check if this really happens, and understand why... */
 					goto next;
@@ -397,6 +391,5 @@
 				if (hdr->avp_value == NULL) {
 					/* This is a sanity check */
-					TRACE_DEBUG(NONE, "Ignored an AVP with unset value in CER/CEA");
-					fd_msg_dump_one(NONE, avp);
+					LOG_F("Ignored an AVP (code %x) with unset value in CER/CEA", hdr->avp_code);
 					ASSERT(0); /* To check if this really happens, and understand why... */
 					goto next;
@@ -419,6 +412,5 @@
 				if (hdr->avp_value == NULL) {
 					/* This is a sanity check */
-					TRACE_DEBUG(NONE, "Ignored an AVP with unset value in CER/CEA");
-					fd_msg_dump_one(NONE, avp);
+					LOG_F("Ignored an AVP (code %x) with unset value in CER/CEA", hdr->avp_code);
 					ASSERT(0); /* To check if this really happens, and understand why... */
 					goto next;
@@ -440,6 +432,5 @@
 				if (hdr->avp_value == NULL) {
 					/* This is a sanity check */
-					TRACE_DEBUG(NONE, "Ignored an AVP with unset value in CER/CEA");
-					fd_msg_dump_one(NONE, avp);
+					LOG_F("Ignored an AVP (code %x) with unset value in CER/CEA", hdr->avp_code);
 					ASSERT(0); /* To check if this really happens, and understand why... */
 					goto next;
@@ -468,6 +459,5 @@
 
 						if (inhdr->avp_flags & AVP_FLAG_VENDOR) {
-							TRACE_DEBUG(FULL, "Ignored a vendor AVP inside Vendor-Specific-Application-Id AVP");
-							fd_msg_dump_one(FULL, avp);
+							LOG_A("Ignored a vendor AVP inside Vendor-Specific-Application-Id AVP");
 							goto innext;
 						}
@@ -475,6 +465,5 @@
 						if (inhdr->avp_value == NULL) {
 							/* This is a sanity check */
-							TRACE_DEBUG(NONE, "Ignored an AVP with unset value in CER/CEA");
-							fd_msg_dump_one(NONE, avp);
+							LOG_F("Ignored an AVP (code %x) with unset value in CER/CEA", hdr->avp_code);
 							ASSERT(0); /* To check if this really happens, and understand why... */
 							goto innext;
@@ -508,6 +497,5 @@
 						
 						if (invalid) {
-							TRACE_DEBUG(FULL, "Invalid Vendor-Specific-Application-Id AVP received, ignored");
-							fd_msg_dump_one(FULL, avp);
+							TRACE_DEBUG(FULL, "Invalid Vendor-Specific-Application-Id AVP received");
 							error->pei_errcode = "DIAMETER_INVALID_AVP_VALUE";
 							error->pei_avp = avp;
@@ -533,6 +521,5 @@
 				if (hdr->avp_value == NULL) {
 					/* This is a sanity check */
-					TRACE_DEBUG(NONE, "Ignored an AVP with unset value in CER/CEA");
-					fd_msg_dump_one(NONE, avp);
+					LOG_F("Ignored an AVP (code %x) with unset value in CER/CEA", hdr->avp_code);
 					ASSERT(0); /* To check if this really happens, and understand why... */
 					goto next;
@@ -549,6 +536,5 @@
 				if (hdr->avp_value == NULL) {
 					/* This is a sanity check */
-					TRACE_DEBUG(NONE, "Ignored an AVP with unset value in CER/CEA");
-					fd_msg_dump_one(NONE, avp);
+					LOG_F("Ignored an AVP (code %x) with unset value in CER/CEA", hdr->avp_code);
 					ASSERT(0); /* To check if this really happens, and understand why... */
 					goto next;
@@ -566,6 +552,5 @@
 				if (hdr->avp_value == NULL) {
 					/* This is a sanity check */
-					TRACE_DEBUG(NONE, "Ignored an AVP with unset value in CER/CEA");
-					fd_msg_dump_one(NONE, avp);
+					LOG_F("Ignored an AVP (code %x) with unset value in CER/CEA", hdr->avp_code);
 					ASSERT(0); /* To check if this really happens, and understand why... */
 					goto next;
@@ -578,6 +563,5 @@
 				if (hdr->avp_value == NULL) {
 					/* This is a sanity check */
-					TRACE_DEBUG(NONE, "Ignored an AVP with unset value in CER/CEA");
-					fd_msg_dump_one(NONE, avp);
+					LOG_F("Ignored an AVP (code %x) with unset value in CER/CEA", hdr->avp_code);
 					ASSERT(0); /* To check if this really happens, and understand why... */
 					goto next;
Index: libfdcore/p_dp.c
===================================================================
--- libfdcore/p_dp.c	(revision 1010)
+++ libfdcore/p_dp.c	(revision 1119)
@@ -76,6 +76,5 @@
 			if (hdr->avp_value == NULL) {
 				/* This is a sanity check */
-				TRACE_DEBUG(NONE, "BUG: Unset value in Disconnect-Cause in DPR");
-				fd_msg_dump_one(NONE, dc);
+				LOG_F("BUG: Unset value in Disconnect-Cause in DPR");
 				ASSERT(0); /* To check if this really happens, and understand why... */
 			}
Index: libfdcore/p_dw.c
===================================================================
--- libfdcore/p_dw.c	(revision 974)
+++ libfdcore/p_dw.c	(revision 1119)
@@ -51,6 +51,5 @@
 		if (hdr->avp_value == NULL) {
 			/* This is a sanity check */
-			TRACE_DEBUG(NONE, "BUG: Unset value in Origin-State-Id in DWR / DWA");
-			fd_msg_dump_one(NONE, osi);
+			LOG_F("Ignored an Origin-State-Id AVP with unset value in DWR/DWA");
 			ASSERT(0); /* To check if this really happens, and understand why... */
 		}
Index: libfdcore/p_out.c
===================================================================
--- libfdcore/p_out.c	(revision 1113)
+++ libfdcore/p_out.c	(revision 1119)
@@ -132,5 +132,5 @@
 				if (msg) {
 					char buf[256];
-					snprintf(buf, sizeof(buf), "Error while sending this message: s", strerror(ret));
+					snprintf(buf, sizeof(buf), "Error while sending this message: %s", strerror(ret));
 					fd_hook_call(HOOK_MESSAGE_DROPPED, msg, NULL, buf, fd_msg_pmdl_get(msg));
 					fd_msg_free(msg);
@@ -186,5 +186,5 @@
 				if (msg) {
 					char buf[256];
-					snprintf(buf, sizeof(buf), "Error while sending this message: s", strerror(ret));
+					snprintf(buf, sizeof(buf), "Error while sending this message: %s", strerror(ret));
 					fd_hook_call(HOOK_MESSAGE_DROPPED, *msg, NULL, buf, fd_msg_pmdl_get(*msg));
 					fd_msg_free(*msg);
Index: libfdcore/p_sr.c
===================================================================
--- libfdcore/p_sr.c	(revision 1113)
+++ libfdcore/p_sr.c	(revision 1119)
@@ -80,6 +80,4 @@
 			(long)((now.tv_nsec >= sr->added_on.tv_nsec) ? (now.tv_sec - sr->added_on.tv_sec) : (now.tv_sec - sr->added_on.tv_sec - 1)),
 			(long)((now.tv_nsec >= sr->added_on.tv_nsec) ? ((now.tv_nsec - sr->added_on.tv_nsec) / 1000) : ((now.tv_nsec - sr->added_on.tv_nsec + 1000000000) / 1000)));
-		
-		fd_msg_dump_one(ANNOYING + 1, sr->req);
 	}
 }
Index: libfdcore/routing_dispatch.c
===================================================================
--- libfdcore/routing_dispatch.c	(revision 1113)
+++ libfdcore/routing_dispatch.c	(revision 1119)
@@ -429,5 +429,5 @@
 {
 	struct msg_hdr * hdr;
-	int is_req = 0, ret;
+	int is_req = 0;
 	struct session * sess;
 	enum disp_action action;
@@ -1079,8 +1079,5 @@
 		}
 		
-		if (TRACE_BOOL(FULL)) {
-			TRACE_DEBUG(FULL, "Picked next message (%s)", action_name);
-			fd_msg_dump_one(ANNOYING, msg);
-		}
+		LOG_A("%s: Picked next message", action_name);
 
 		/* Now process the message */
Index: libfdproto/dictionary.c
===================================================================
--- libfdproto/dictionary.c	(revision 1093)
+++ libfdproto/dictionary.c	(revision 1119)
@@ -1278,4 +1278,5 @@
 		}
 	}
+	return *buf;
 }
 
Index: libfdproto/log.c
===================================================================
--- libfdproto/log.c	(revision 1094)
+++ libfdproto/log.c	(revision 1119)
@@ -212,7 +212,7 @@
 static size_t get_mempagesz(void) {
 	if (!sys_mempagesz) {
-		sys_mempagesz = sysconf(_SC_PAGESIZE); /* We alloc buffer by memory pages for efficiency */
+		sys_mempagesz = sysconf(_SC_PAGESIZE); /* We alloc buffer by memory pages for efficiency. This can be readjusted if too memory consuming */
 		if (sys_mempagesz <= 0)
-			sys_mempagesz = 1024; /* default size if above call failed */
+			sys_mempagesz = 256; /* default size if above call failed */
 	}
 	return sys_mempagesz;
Index: libfdproto/messages.c
===================================================================
--- libfdproto/messages.c	(revision 1113)
+++ libfdproto/messages.c	(revision 1119)
@@ -921,5 +921,5 @@
 	
 	if (!CHECK_MSG(msg)) {
-		CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "INVALID MESSAGE", msg), return NULL);
+		CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "INVALID MESSAGE"), return NULL);
 		return *buf;
 	}
@@ -955,7 +955,4 @@
 	int success = 0;
 	struct dict_avp_data  dictdata;
-	struct dict_vendor_data  vendordata;
-	struct dict_vendor_data *vendorinfo = NULL;
-	
 	
 	if (level) {
@@ -1153,14 +1150,4 @@
 }
 
-#ifndef OLD_CODE_TO_BE_REPLACED
-void fd_msg_dump_walk ( int level, msg_or_avp *obj )
-{
-	LOG_D("fd_msg_dump_walk %d, %p is deprecated", level, obj);
-}
-void fd_msg_dump_one ( int level, msg_or_avp * obj )
-{
-	LOG_D("fd_msg_dump_one %d, %p is deprecated", level, obj);
-}
-#endif
 /***************************************************************************************************************/
 /* Simple meta-data management */
@@ -2058,9 +2045,14 @@
 		
 		if (mandatory && (avp->avp_public.avp_flags & AVP_FLAG_MANDATORY)) {
-			TRACE_DEBUG(INFO, "Unsupported mandatory AVP found:");
-			fd_msg_dump_one(INFO, avp);
+			TRACE_DEBUG(INFO, "Unsupported mandatory AVP found");
 			if (error_info) {
 				error_info->pei_errcode = "DIAMETER_AVP_UNSUPPORTED";
 				error_info->pei_avp = avp;
+			} else {
+				char * buf = NULL;
+				size_t buflen;
+				CHECK_MALLOC(fd_msg_dump_treeview(&buf, &buflen, NULL, avp, NULL, 0, 0));
+				LOG_E("Unsupported AVP: %s", buf);
+				free(buf);
 			}
 			return ENOTSUP;
@@ -2102,6 +2094,5 @@
 	if ((avp_value_sizes[dictdata.avp_basetype] != 0) &&
 	    (avp->avp_public.avp_len - GETAVPHDRSZ( avp->avp_public.avp_flags ) != avp_value_sizes[dictdata.avp_basetype])) {
-		TRACE_DEBUG(INFO, "The AVP size is not suitable for the type:");
-		fd_msg_dump_one(INFO, avp);
+		TRACE_DEBUG(INFO, "The AVP size is not suitable for the type");
 		if (error_info) {
 			error_info->pei_errcode = "DIAMETER_INVALID_AVP_LENGTH";
@@ -2109,4 +2100,10 @@
 			snprintf(error_message, sizeof(error_message), "I expected a size of %d for this AVP according to my dictionary", avp_value_sizes[dictdata.avp_basetype]);
 			error_info->pei_message = error_message;
+		} else {
+			char * buf = NULL;
+			size_t buflen;
+			CHECK_MALLOC(fd_msg_dump_treeview(&buf, &buflen, NULL, avp, NULL, 0, 0));
+			LOG_E("Invalid length AVP: %s", buf);
+			free(buf);
 		}
 		avp->avp_model = NULL;
Index: libfdproto/rt_data.c
===================================================================
--- libfdproto/rt_data.c	(revision 1097)
+++ libfdproto/rt_data.c	(revision 1119)
@@ -252,7 +252,4 @@
 int  fd_rtd_get_nb_attempts(struct rt_data * rtd, int * sendingattemtps)
 {
-	struct fd_list * li;
-	int match = 0;
-	
 	TRACE_ENTRY("%p %p", rtd, sendingattemtps);
 	CHECK_PARAMS( rtd && sendingattemtps );
Index: libfdproto/utils.c
===================================================================
--- libfdproto/utils.c	(revision 1103)
+++ libfdproto/utils.c	(revision 1119)
@@ -66,5 +66,5 @@
 			CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "%s", gai_strerror(rc)), return NULL);
 		} else {
-			CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "%s(s)", &addrbuf[0], &servbuf[0]), return NULL);
+			CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "%s(%s)", &addrbuf[0], &servbuf[0]), return NULL);
 		}
 	} else {
Index: tests/testmesg_stress.c
===================================================================
--- tests/testmesg_stress.c	(revision 1093)
+++ tests/testmesg_stress.c	(revision 1119)
@@ -53,5 +53,4 @@
 {
 	struct msg * acr = NULL;
-	struct avp * pi = NULL, *avp1, *avp2;
 	unsigned char * buf = NULL;
 	
@@ -217,5 +216,4 @@
 		struct msg         * msg = NULL;
 		struct dict_object * avp_model = NULL;
-		struct avp         * avp = NULL;
 		union avp_value      value;
 		
@@ -226,5 +224,4 @@
 			struct avp * avpi = NULL;
 			struct avp * avpch = NULL;
-			struct avp_hdr * avpdata = NULL;
 			struct msg_hdr * msgdata = NULL;
 			#define ADD_AVP( _parent, _position, _avpi, _avpvendor, _avpname) {			\
@@ -392,7 +389,4 @@
 		struct timespec start, end;
 		
-		struct msg * msg;
-		
-		
 		/* Create the copies of the message buffer */
 		stress_array = calloc(test_parameter, sizeof(struct stress_struct));
