Index: libfdcore/config.c
===================================================================
--- libfdcore/config.c	(revision 1034)
+++ libfdcore/config.c	(revision 1085)
@@ -81,66 +81,69 @@
 }
 
-void fd_conf_dump()
+DECLARE_FD_DUMP_PROTOTYPE(fd_conf_dump)
 {
-	if (!TRACE_BOOL(INFO))
-		return;
-	
-	fd_log_debug("-- Configuration :");
-	fd_log_debug("  Debug trace level ...... : %+d", fd_g_debug_lvl);
-	fd_log_debug("  Configuration file ..... : %s", fd_g_config->cnf_file);
-	fd_log_debug("  Diameter Identity ...... : %s (l:%Zi)", fd_g_config->cnf_diamid, fd_g_config->cnf_diamid_len);
-	fd_log_debug("  Diameter Realm ......... : %s (l:%Zi)", fd_g_config->cnf_diamrlm, fd_g_config->cnf_diamrlm_len);
-	fd_log_debug("  Tc Timer ............... : %u", fd_g_config->cnf_timer_tc);
-	fd_log_debug("  Tw Timer ............... : %u", fd_g_config->cnf_timer_tw);
-	fd_log_debug("  Local port ............. : %hu", fd_g_config->cnf_port);
-	fd_log_debug("  Local secure port ...... : %hu", fd_g_config->cnf_port_tls);
-	fd_log_debug("  Number of SCTP streams . : %hu", fd_g_config->cnf_sctp_str);
-	fd_log_debug("  Number of server threads : %hu", fd_g_config->cnf_dispthr);
+	size_t o=0;
+	if (!offset)
+		offset = &o;
+	
+	CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "{freeDiameter configuration}(@%p): \n", fd_g_config), 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);
+	CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "  Diameter Identity ...... : %s (l:%Zi)\n", fd_g_config->cnf_diamid, fd_g_config->cnf_diamid_len), return NULL);
+	CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "  Diameter Realm ......... : %s (l:%Zi)\n", fd_g_config->cnf_diamrlm, fd_g_config->cnf_diamrlm_len), return NULL);
+	CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "  Tc Timer ............... : %u\n", fd_g_config->cnf_timer_tc), return NULL);
+	CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "  Tw Timer ............... : %u\n", fd_g_config->cnf_timer_tw), return NULL);
+	CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "  Local port ............. : %hu\n", fd_g_config->cnf_port), return NULL);
+	CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "  Local secure port ...... : %hu\n", fd_g_config->cnf_port_tls), return NULL);
+	CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "  Number of SCTP streams . : %hu\n", fd_g_config->cnf_sctp_str), return NULL);
+	CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "  Number of server threads : %hu\n", fd_g_config->cnf_dispthr), return NULL);
 	if (FD_IS_LIST_EMPTY(&fd_g_config->cnf_endpoints)) {
-		fd_log_debug("  Local endpoints ........ : Default (use all available)");
+		CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "  Local endpoints ........ : Default (use all available)\n"), return NULL);
 	} else {
-		fd_log_debug("  Local endpoints ........ : ");
-		fd_ep_dump( 29, &fd_g_config->cnf_endpoints );
+		CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "  Local endpoints ........ : \n"), return NULL);
+		CHECK_MALLOC_DO( fd_ep_dump( FD_DUMP_STD_PARAMS, 29, &fd_g_config->cnf_endpoints ), return NULL);
 	}
 	if (FD_IS_LIST_EMPTY(&fd_g_config->cnf_apps)) {
-		fd_log_debug("  Local applications ..... : (none)");
+		CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "  Local applications ..... : (none)\n"), return NULL);
 	} else {
 		struct fd_list * li = fd_g_config->cnf_apps.next;
-		fd_log_debug("  Local applications ..... : ");
+		CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "  Local applications ..... : \n"), return NULL);
 		while (li != &fd_g_config->cnf_apps) {
 			struct fd_app * app = (struct fd_app *)li;
-			if (li != fd_g_config->cnf_apps.next) fd_log_debug("                             ");
-			fd_log_debug("App: %u\t%s%s\tVnd: %u", 
+			CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "                             App: %u\t%s%s\tVnd: %u\n", 
 					app->appid,
 					app->flags.auth ? "Au" : "--",
 					app->flags.acct ? "Ac" : "--",
-					app->vndid);
+					app->vndid), return NULL);
 			li = li->next;
 		}
 	}
 	
-	fd_log_debug("  Flags : - IP ........... : %s", fd_g_config->cnf_flags.no_ip4 ? "DISABLED" : "Enabled");
-	fd_log_debug("          - IPv6 ......... : %s", fd_g_config->cnf_flags.no_ip6 ? "DISABLED" : "Enabled");
-	fd_log_debug("          - Relay app .... : %s", fd_g_config->cnf_flags.no_fwd ? "DISABLED" : "Enabled");
-	fd_log_debug("          - TCP .......... : %s", fd_g_config->cnf_flags.no_tcp ? "DISABLED" : "Enabled");
+	CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "  Flags : - IP ........... : %s\n", fd_g_config->cnf_flags.no_ip4 ? "DISABLED" : "Enabled"), return NULL);
+	CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "          - IPv6 ......... : %s\n", fd_g_config->cnf_flags.no_ip6 ? "DISABLED" : "Enabled"), return NULL);
+	CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "          - Relay app .... : %s\n", fd_g_config->cnf_flags.no_fwd ? "DISABLED" : "Enabled"), return NULL);
+	CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "          - TCP .......... : %s\n", fd_g_config->cnf_flags.no_tcp ? "DISABLED" : "Enabled"), return NULL);
 	#ifdef DISABLE_SCTP
-	fd_log_debug("          - SCTP ......... : DISABLED (at compilation)");
+	CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "          - SCTP ......... : DISABLED (at compilation)\n"), return NULL);
 	#else /* DISABLE_SCTP */
-	fd_log_debug("          - SCTP ......... : %s", fd_g_config->cnf_flags.no_sctp ? "DISABLED" : "Enabled");
+	CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "          - SCTP ......... : %s\n", fd_g_config->cnf_flags.no_sctp ? "DISABLED" : "Enabled"), return NULL);
 	#endif /* DISABLE_SCTP */
-	fd_log_debug("          - Pref. proto .. : %s", fd_g_config->cnf_flags.pr_tcp ? "TCP" : "SCTP");
-	fd_log_debug("          - TLS method ... : %s", fd_g_config->cnf_flags.tls_alg ? "INBAND" : "Separate port");
-	
-	fd_log_debug("  TLS :   - Certificate .. : %s", fd_g_config->cnf_sec_data.cert_file ?: "(NONE)");
-	fd_log_debug("          - Private key .. : %s", fd_g_config->cnf_sec_data.key_file ?: "(NONE)");
-	fd_log_debug("          - CA (trust) ... : %s (%d certs)", fd_g_config->cnf_sec_data.ca_file ?: "(none)", fd_g_config->cnf_sec_data.ca_file_nr);
-	fd_log_debug("          - CRL .......... : %s", fd_g_config->cnf_sec_data.crl_file ?: "(none)");
-	fd_log_debug("          - Priority ..... : %s", fd_g_config->cnf_sec_data.prio_string ?: "(default: '" GNUTLS_DEFAULT_PRIORITY "')");
-	if (fd_g_config->cnf_sec_data.dh_file)
-		fd_log_debug("          - DH file ...... : %s", fd_g_config->cnf_sec_data.dh_file);
-	else
-		fd_log_debug("          - DH bits ...... : %d", fd_g_config->cnf_sec_data.dh_bits ?: GNUTLS_DEFAULT_DHBITS);
-	
-	fd_log_debug("  Origin-State-Id ........ : %u", fd_g_config->cnf_orstateid);
+	CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "          - Pref. proto .. : %s\n", fd_g_config->cnf_flags.pr_tcp ? "TCP" : "SCTP"), return NULL);
+	CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "          - TLS method ... : %s\n", fd_g_config->cnf_flags.tls_alg ? "INBAND" : "Separate port"), return NULL);
+	
+	CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "  TLS :   - Certificate .. : %s\n", fd_g_config->cnf_sec_data.cert_file ?: "(NONE)"), return NULL);
+	CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "          - Private key .. : %s\n", fd_g_config->cnf_sec_data.key_file ?: "(NONE)"), return NULL);
+	CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "          - CA (trust) ... : %s (%d certs)\n", fd_g_config->cnf_sec_data.ca_file ?: "(none)", fd_g_config->cnf_sec_data.ca_file_nr), return NULL);
+	CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "          - CRL .......... : %s\n", fd_g_config->cnf_sec_data.crl_file ?: "(none)"), return NULL);
+	CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "          - Priority ..... : %s\n", fd_g_config->cnf_sec_data.prio_string ?: "(default: '" GNUTLS_DEFAULT_PRIORITY "')"), return NULL);
+	if (fd_g_config->cnf_sec_data.dh_file) {
+		CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "          - DH file ...... : %s\n", fd_g_config->cnf_sec_data.dh_file), return NULL);
+	} else {
+		CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "          - DH bits ...... : %d\n", fd_g_config->cnf_sec_data.dh_bits ?: GNUTLS_DEFAULT_DHBITS), return NULL);
+	}
+	
+	CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "  Origin-State-Id ........ : %u", fd_g_config->cnf_orstateid), return NULL);
+	
+	return *buf;
 }
 
Index: libfdcore/core.c
===================================================================
--- libfdcore/core.c	(revision 1079)
+++ libfdcore/core.c	(revision 1085)
@@ -85,30 +85,4 @@
 		CHECK_FCT_DO(  fd_event_get(fd_g_config->cnf_main_ev, &code, &sz, &data),  break  );
 		switch (code) {
-			case FDEV_DUMP_DICT:
-				fd_dict_dump(fd_g_config->cnf_dict);
-				break;
-			
-			case FDEV_DUMP_EXT:
-				fd_ext_dump();
-				break;
-			
-			case FDEV_DUMP_SERV:
-				fd_servers_dump();
-				break;
-			
-			case FDEV_DUMP_QUEUES:
-				fd_fifo_dump(0, "Incoming messages", fd_g_incoming, fd_msg_dump_walk);
-				fd_fifo_dump(0, "Outgoing messages", fd_g_outgoing, fd_msg_dump_walk);
-				fd_fifo_dump(0, "Local messages",    fd_g_local,    fd_msg_dump_walk);
-				break;
-			
-			case FDEV_DUMP_CONFIG:
-				fd_conf_dump();
-				break;
-			
-			case FDEV_DUMP_PEERS:
-				fd_peer_dump_list(FULL);
-				break;
-			
 			case FDEV_TRIGGER:
 				{
@@ -182,5 +156,5 @@
 	}
 	
-	TRACE_DEBUG(INFO, "libfdproto initialized.");
+	LOG_D("libfdproto initialized.");
 	
 	/* Name this thread */
@@ -225,4 +199,8 @@
 int fd_core_parseconf(const char * conffile)
 {
+	char * buf = NULL, *b;
+	size_t len = 0, offset=0;
+	
+	
 	TRACE_ENTRY("%p", conffile);
 	
@@ -240,9 +218,15 @@
 	
 	/* Display configuration */
-	fd_conf_dump();
+	b = fd_conf_dump(&buf, &len, NULL);
+	LOG_N("%s\n", b ?: "Error during configuration dump...");
 	
 	/* Display registered triggers for FDEV_TRIGGER */
-	fd_event_trig_dump();
-	
+	b = fd_event_trig_dump(&buf, &len, &offset);
+	if (!b || offset) {
+		LOG_N("%s\n", b ?: "Error during triggers dump...");
+	}
+	
+	free(buf);	
+		
 	return 0;
 }
Index: libfdcore/endpoints.c
===================================================================
--- libfdcore/endpoints.c	(revision 1033)
+++ libfdcore/endpoints.c	(revision 1085)
@@ -58,17 +58,4 @@
 	}
 	
-	if (TRACE_BOOL(ANNOYING + 1)) {
-		char buf[1024];
-		sSA_DUMP_NODE_SERV( buf, sizeof(buf), sa, NI_NUMERICHOST | NI_NUMERICSERV );
-		TRACE_DEBUG(ANNOYING, "  DEBUG:fd_ep_add_merge  Current list:");
-		fd_ep_dump( 4, list );
-		TRACE_DEBUG(ANNOYING, "  DEBUG:fd_ep_add_merge  Adding:");
-		fd_log_debug("    %s {%s%s%s%s%s}", buf,
-				(flags & EP_FL_CONF) 	? "C" : "-",
-				(flags & EP_FL_DISC)	    ? "D" : "-",
-				(flags & EP_FL_ADV)	    ? "A" : "-",
-				(flags & EP_FL_LL)	    ? "L" : "-",
-				(flags & EP_FL_PRIMARY)     ? "P" : "-");
-	}
 	ptr.sa = sa;
 	
@@ -82,7 +69,5 @@
 				 || ((ntohl(ptr.sin->sin_addr.s_addr) & 0xe0000000) == 0xe0000000)
 				 || (ptr.sin->sin_addr.s_addr == INADDR_BROADCAST)) {
-					if (TRACE_BOOL(ANNOYING + 1)) {
-						TRACE_DEBUG(ANNOYING, "  DEBUG:fd_ep_add_merge  Address was ignored, not added.");
-					}
+					LOG_A("  DEBUG:fd_ep_add_merge  Address was ignored, not added.");
 					return 0;
 				}
@@ -98,7 +83,5 @@
 				 || IN6_IS_ADDR_LINKLOCAL(&ptr.sin6->sin6_addr)
 				 || IN6_IS_ADDR_SITELOCAL(&ptr.sin6->sin6_addr)) {
-					if (TRACE_BOOL(ANNOYING + 1)) {
-						TRACE_DEBUG(ANNOYING, "  DEBUG:fd_ep_add_merge  Address was ignored, not added.");
-					}
+					LOG_A("  DEBUG:fd_ep_add_merge  Address was ignored, not added.");
 					return 0;
 				}
@@ -108,7 +91,5 @@
 
 		default:
-			if (TRACE_BOOL(ANNOYING + 1)) {
-				TRACE_DEBUG(ANNOYING, "  DEBUG:fd_ep_add_merge  Address family was unknown, not added.");
-			}
+			LOG_A("  DEBUG:fd_ep_add_merge  Address family was unknown, not added.");
 			return 0;
 	}
@@ -175,8 +156,4 @@
 	ep->flags |= flags;
 	
-	if (TRACE_BOOL(ANNOYING + 1)) {
-		TRACE_DEBUG(ANNOYING, "  DEBUG:fd_ep_add_merge  New list:");
-		fd_ep_dump( 4, list );
-	}
 	return 0;
 }
@@ -190,8 +167,4 @@
 	CHECK_PARAMS(list);
 	
-	if (TRACE_BOOL(ANNOYING + 1)) {
-		TRACE_DEBUG(ANNOYING, "  DEBUG:fd_ep_filter  Filter this list for flags %x:", flags);
-		fd_ep_dump( 4, list );
-	}
 	for (li = list->next; li != list; li = li->next) {
 		struct fd_endpoint * ep = (struct fd_endpoint *)li;
@@ -204,8 +177,4 @@
 	}
 	
-	if (TRACE_BOOL(ANNOYING + 1)) {
-		TRACE_DEBUG(ANNOYING, "  DEBUG:fd_ep_filter  Resulting list:");
-		fd_ep_dump( 4, list );
-	}
 	return 0;
 }
@@ -219,8 +188,4 @@
 	CHECK_PARAMS(list);
 	
-	if (TRACE_BOOL(ANNOYING + 1)) {
-		TRACE_DEBUG(ANNOYING, "  DEBUG:fd_ep_filter_family  Filter this list for family %d:", af);
-		fd_ep_dump( 4, list );
-	}
 	for (li = list->next; li != list; li = li->next) {
 		struct fd_endpoint * ep = (struct fd_endpoint *)li;
@@ -233,8 +198,4 @@
 	}
 	
-	if (TRACE_BOOL(ANNOYING + 1)) {
-		TRACE_DEBUG(ANNOYING, "  DEBUG:fd_ep_filter_family  Resulting list:");
-		fd_ep_dump( 4, list );
-	}
 	return 0;
 }
@@ -253,10 +214,4 @@
 	li_ex = exclude_list->next;
 	
-	if (TRACE_BOOL(ANNOYING + 1)) {
-		TRACE_DEBUG(ANNOYING, "  DEBUG:fd_ep_filter_list  Filter this list ");
-		fd_ep_dump( 4, list );
-		TRACE_DEBUG(ANNOYING, "  DEBUG:fd_ep_filter_list  Removing from list");
-		fd_ep_dump( 6, exclude_list );
-	}
 	/* Now browse both lists in parallel */
 	while ((li_out != list) && (li_ex != exclude_list)) {
@@ -304,8 +259,4 @@
 	}
 	
-	if (TRACE_BOOL(ANNOYING + 1)) {
-		TRACE_DEBUG(ANNOYING, "  DEBUG:fd_ep_filter_list  Resulting list:");
-		fd_ep_dump( 4, list );
-	}
 	return 0;
 
@@ -334,25 +285,43 @@
 }
 
-void fd_ep_dump_one( char * prefix, struct fd_endpoint * ep )
-{
-	char buf[1024];
-	
-	sSA_DUMP_NODE_SERV( buf, sizeof(buf), &ep->sa, NI_NUMERICHOST | NI_NUMERICSERV );
-	fd_log_debug("%s%s {%s%s%s%s}%s", prefix ?: "", buf,
+DECLARE_FD_DUMP_PROTOTYPE(fd_ep_dump_one, struct fd_endpoint * ep )
+{
+	size_t o = 0;
+	if (!offset)
+		offset=&o;
+	
+	CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "{ep}(@%p): ", ep), return NULL);
+	
+	if (!ep) {
+		CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "INVALID/NULL\n"), return NULL);
+		return *buf;
+	}
+	
+	CHECK_MALLOC_DO( fd_sa_dump_node_serv( FD_DUMP_STD_PARAMS, &ep->sa, NI_NUMERICHOST | NI_NUMERICSERV ), return NULL);
+	CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, " {%s%s%s%s%s}",
 			(ep->flags & EP_FL_CONF) 	? "C" : "-",
 			(ep->flags & EP_FL_DISC) 	? "D" : "-",
 			(ep->flags & EP_FL_ADV) 	? "A" : "-",
 			(ep->flags & EP_FL_LL) 		? "L" : "-",
-			(ep->flags & EP_FL_PRIMARY) 	? "P" : "-");
-}
-
-void fd_ep_dump( int indent, struct fd_list * eps )
-{
-	struct fd_list * li;
-	for (li = eps->next; li != eps; li = li->next) {
-		struct fd_endpoint * ep = (struct fd_endpoint *)li;
-		fd_log_debug("%*s", indent, "");
-		fd_ep_dump_one( NULL, ep );
-	}
-}
-	
+			(ep->flags & EP_FL_PRIMARY) 	? "P" : "-"), return NULL);
+	return *buf;
+}
+
+DECLARE_FD_DUMP_PROTOTYPE(fd_ep_dump, int indent, struct fd_list * eps  )
+{
+	struct fd_list * li;
+	size_t o = 0;
+	if (!offset)
+		offset=&o;
+	
+	CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "%*s{eps}(@%p):\n", indent, "", eps), return NULL);
+	if (eps) {
+		for (li = eps->next; li != eps; li = li->next) {
+			struct fd_endpoint * ep = (struct fd_endpoint *)li;
+			CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "%*s", indent+1, ""), return NULL);
+			CHECK_MALLOC_DO( fd_ep_dump_one( FD_DUMP_STD_PARAMS, ep ), return NULL);
+			CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "\n"), return NULL);
+		}
+	}
+}
+	
Index: libfdcore/events.c
===================================================================
--- libfdcore/events.c	(revision 974)
+++ libfdcore/events.c	(revision 1085)
@@ -106,10 +106,4 @@
 		case _val : return #_val
 		case_str(FDEV_TERMINATE);
-		case_str(FDEV_DUMP_DICT);
-		case_str(FDEV_DUMP_EXT);
-		case_str(FDEV_DUMP_SERV);
-		case_str(FDEV_DUMP_QUEUES);
-		case_str(FDEV_DUMP_CONFIG);
-		case_str(FDEV_DUMP_PEERS);
 		case_str(FDEV_TRIGGER);
 		
@@ -168,9 +162,10 @@
 }
 
-void fd_event_trig_dump()
+DECLARE_FD_DUMP_PROTOTYPE(fd_event_trig_dump)
 {
 	struct fd_list * li;
-	if (!TRACE_BOOL(FULL))
-		return;
+	size_t o=0;
+	if (!offset)
+		offset=&o;
 	
 	CHECK_POSIX_DO( pthread_rwlock_rdlock(&trig_rwl),  );
@@ -178,8 +173,9 @@
 	for (li = trig_list.next; li != &trig_list; li = li->next) {
 		struct trig_item *t = li->o;
-		fd_log_debug("  Trigger %d, module '%s': %p", t->trig_value, t->trig_module, t->cb);
+		CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "{trigger sig:%d}'%s'->%p ", t->trig_value, t->trig_module, t->cb), break);
 	}
 	
 	CHECK_POSIX_DO( pthread_rwlock_unlock(&trig_rwl),  );
+	return *buf;
 }
 
Index: libfdcore/extensions.c
===================================================================
--- libfdcore/extensions.c	(revision 1006)
+++ libfdcore/extensions.c	(revision 1085)
@@ -78,15 +78,17 @@
 
 /* Dump the list */
-void fd_ext_dump(void)
+DECLARE_FD_DUMP_PROTOTYPE(fd_ext_dump)
 {
 	struct fd_list * li;
-	
-	fd_log_debug("Dumping extensions list :");
+	size_t o=0;
+	if (!offset)
+		offset = &o;
 	
 	for (li = ext_list.next; li != &ext_list; li = li->next)
 	{
 		struct fd_ext_info * ext = (struct fd_ext_info *)li;
-		fd_log_debug(" - '%s'[%s] is %sloaded", ext->filename, ext->conffile?:"no conf", ext->handler ? "" : "not ");
-	}
+		CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "{extension}(@%p): '%s'[%s], %sloaded\n", ext, ext->filename, ext->conffile?:"no conf", ext->handler ? "" : "not "), return NULL);
+	}
+	return *buf;
 }
 
Index: libfdcore/fdcore-internal.h
===================================================================
--- libfdcore/fdcore-internal.h	(revision 1016)
+++ libfdcore/fdcore-internal.h	(revision 1085)
@@ -86,5 +86,4 @@
 int fd_conf_init();
 int fd_conf_deinit();
-void fd_conf_dump();
 int fd_conf_parse();
 int fddparse(struct fd_config * conf); /* yacc generated */
@@ -95,5 +94,4 @@
 int fd_ext_add( char * filename, char * conffile );
 int fd_ext_load();
-void fd_ext_dump(void);
 int fd_ext_term(void);
 
@@ -218,9 +216,6 @@
 /* Events codespace for struct fd_peer->p_events */
 enum {
-	/* Dump all info about this peer in the debug log */
-	 FDEVP_DUMP_ALL = 1500
-	
 	/* request to terminate this peer : disconnect, requeue all messages */
-	,FDEVP_TERMINATE
+	FDEVP_TERMINATE = 1500
 	
 	/* A connection object has received a message. (data contains the buffer + struct timespec piggytailed -- unaligned) */
@@ -250,5 +245,5 @@
 };
 #define CHECK_PEVENT( _e ) \
-	(((int)(_e) >= FDEVP_DUMP_ALL) && ((int)(_e) <= FDEVP_PSM_TIMEOUT))
+	(((int)(_e) >= FDEVP_TERMINATE) && ((int)(_e) <= FDEVP_PSM_TIMEOUT))
 /* The following macro is actually called in p_psm.c -- another solution would be to declare it static inline */
 #define DECLARE_PEV_STR()				\
@@ -256,5 +251,4 @@
 {							\
 	switch (event) {				\
-		case_str(FDEVP_DUMP_ALL);		\
 		case_str(FDEVP_TERMINATE);		\
 		case_str(FDEVP_CNX_MSG_RECV);		\
@@ -281,6 +275,4 @@
 /* Functions */
 int  fd_peer_fini();
-void fd_peer_dump_list(int details);
-void fd_peer_dump(struct fd_peer * peer, int details);
 int  fd_peer_alloc(struct fd_peer ** ptr);
 int  fd_peer_free(struct fd_peer ** ptr);
@@ -339,5 +331,4 @@
 
 /* Server sockets */
-void fd_servers_dump();
 int  fd_servers_start();
 int  fd_servers_stop();
Index: libfdcore/p_psm.c
===================================================================
--- libfdcore/p_psm.c	(revision 1078)
+++ libfdcore/p_psm.c	(revision 1085)
@@ -454,10 +454,4 @@
 	}
 
-	/* Handle the (easy) debug event now */
-	if (event == FDEVP_DUMP_ALL) {
-		fd_peer_dump(peer, ANNOYING);
-		goto psm_loop;
-	}
-
 	/* Requests to terminate the peer object */
 	if (event == FDEVP_TERMINATE) {
@@ -712,9 +706,10 @@
 		CHECK_FCT_DO( fd_cnx_getremoteeps(peer->p_cnxctx, &peer->p_hdr.info.pi_endpoints), /* ignore the error */);
 		
-		/* We do not support local endpoints change currently, but it could be added here if needed (refresh fd_g_config->cnf_endpoints)*/
-		
-		if (TRACE_BOOL(ANNOYING)) {
-			TRACE_DEBUG(ANNOYING, "New remote endpoint(s):" );
-			fd_ep_dump(6, &peer->p_hdr.info.pi_endpoints);
+		/* We do not support local endpoints change currently, but it could be added here if needed (refresh fd_g_config->cnf_endpoints) */
+		{
+			char * buf = NULL;
+			size_t len = 0;
+			LOG_D("New remote endpoint(s): %s",  fd_ep_dump(&buf, &len, NULL, 6, &peer->p_hdr.info.pi_endpoints) ?: "error");
+			free(buf);
 		}
 		
Index: libfdcore/peers.c
===================================================================
--- libfdcore/peers.c	(revision 1078)
+++ libfdcore/peers.c	(revision 1085)
@@ -410,51 +410,61 @@
 
 /* Dump info of one peer */
-void fd_peer_dump(struct fd_peer * peer, int details)
-{
-	char buf[1024];
-	if (peer->p_eyec != EYEC_PEER) {
-		fd_log_debug("  Invalid peer @ %p !", peer);
-		return;
-	}
-
-	snprintf(buf, sizeof(buf), ">  %s\t%s\t[%ldsr,%ldpa]", STATE_STR(fd_peer_getstate(peer)), peer->p_hdr.info.pi_diamid, peer->p_sr.cnt, peer->p_reqin_count);
-	if (details > INFO) {
-		snprintf(buf+strlen(buf), sizeof(buf)-strlen(buf), "\t(rlm:%s)", peer->p_hdr.info.runtime.pir_realm ?: "<unknown>");
-		if (peer->p_hdr.info.runtime.pir_prodname)
-			snprintf(buf+strlen(buf), sizeof(buf)-strlen(buf), "\t['%s' %u]", peer->p_hdr.info.runtime.pir_prodname, peer->p_hdr.info.runtime.pir_firmrev);
-	}
-	fd_log_debug("%s", buf);
-	if (details > FULL) {
-		/* Dump all info */
-		fd_log_debug("\tEntry origin : %s", peer->p_dbgorig?: "not set");
-		fd_log_debug("\tConfig flags : %s%s%s - %s%s - %s%s", 
-				peer->p_hdr.info.config.pic_flags.pro3 == PI_P3_DEFAULT ? "." :
-					(peer->p_hdr.info.config.pic_flags.pro3 == PI_P3_IP ? "IP" : "IPv6"),
-				peer->p_hdr.info.config.pic_flags.pro4 == PI_P4_DEFAULT ? "." :
-					(peer->p_hdr.info.config.pic_flags.pro4 == PI_P4_TCP ? "TCP" : "SCTP"),
-				peer->p_hdr.info.config.pic_flags.alg ? "PrefTCP" : ".",
-				peer->p_hdr.info.config.pic_flags.sec & PI_SEC_NONE ? "NoTLSok" :".",
-				peer->p_hdr.info.config.pic_flags.sec & PI_SEC_TLS_OLD ? "OldTLS" :".",
-				peer->p_hdr.info.config.pic_flags.exp ? "Expire" : ".",
-				peer->p_hdr.info.config.pic_flags.persist ? "Persist" : "."
-				);
-		fd_log_debug("\tLifetime : %d sec", peer->p_hdr.info.config.pic_lft);
-	}
+DECLARE_FD_DUMP_PROTOTYPE(fd_peer_dump, struct peer_hdr * p, int details)
+{
+	size_t o=0;
+	if (!offset)
+		offset = &o;
+	
+	CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "{peer}(@%p): ", p), return NULL);
+	
+	if (!CHECK_PEER(p)) {
+		CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "INVALID/NULL"), return NULL);
+	} else {
+		struct fd_peer * peer = (struct fd_peer *)p;
+		
+		CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "%s [%s, cnt:%ldsr,%ldpa]", peer->p_hdr.info.pi_diamid, STATE_STR(fd_peer_getstate(peer)), peer->p_sr.cnt, peer->p_reqin_count), return NULL);
+		if (details > 0) {
+			CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, " rlm:%s", peer->p_hdr.info.runtime.pir_realm ?: "<unknown>"), return NULL);
+			if (peer->p_hdr.info.runtime.pir_prodname) {
+				CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, " ['%s' %u]", peer->p_hdr.info.runtime.pir_prodname, peer->p_hdr.info.runtime.pir_firmrev), return NULL);
+			}
+		}
+		if (details > 1) {
+			CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, " [from:%s] flags:%s%s%s%s%s%s%s lft:%ds", 
+				peer->p_dbgorig ?: "unset",
+				peer->p_hdr.info.config.pic_flags.pro3 == PI_P3_DEFAULT ? "-" :
+					(peer->p_hdr.info.config.pic_flags.pro3 == PI_P3_IP ? "4" : "6"),
+				peer->p_hdr.info.config.pic_flags.pro4 == PI_P4_DEFAULT ? "-" :
+					(peer->p_hdr.info.config.pic_flags.pro4 == PI_P4_TCP ? "T" : "S"),
+				peer->p_hdr.info.config.pic_flags.alg ? "P" : "-",
+				peer->p_hdr.info.config.pic_flags.sec & PI_SEC_NONE ? "N" :"-",
+				peer->p_hdr.info.config.pic_flags.sec & PI_SEC_TLS_OLD ? "O" :"-",
+				peer->p_hdr.info.config.pic_flags.exp ? "E" : "-",
+				peer->p_hdr.info.config.pic_flags.persist ? "P" : "-",
+				peer->p_hdr.info.config.pic_lft), return NULL);
+		}
+	
+	}
+	
+	return *buf;
 }
 
 /* Dump the list of peers */
-void fd_peer_dump_list(int details)
+DECLARE_FD_DUMP_PROTOTYPE(fd_peer_dump_list, int details)
 {
 	struct fd_list * li;
-	
-	fd_log_debug("Dumping list of peers :");
+	size_t o=0;
+	if (!offset)
+		offset = &o;
+	
 	CHECK_FCT_DO( pthread_rwlock_rdlock(&fd_g_peers_rw), /* continue */ );
 	
 	for (li = fd_g_peers.next; li != &fd_g_peers; li = li->next) {
-		struct fd_peer * np = (struct fd_peer *)li->o;
-		fd_peer_dump(np, details);
+		CHECK_MALLOC_DO( fd_peer_dump(FD_DUMP_STD_PARAMS, (struct peer_hdr *)li->o, details), break);
+		CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "\n"), break);
 	}
 	
 	CHECK_FCT_DO( pthread_rwlock_unlock(&fd_g_peers_rw), /* continue */ );
+	return *buf;
 }
 
Index: libfdcore/server.c
===================================================================
--- libfdcore/server.c	(revision 1078)
+++ libfdcore/server.c	(revision 1085)
@@ -94,14 +94,16 @@
 
 /* Dump all servers information */
-void fd_servers_dump()
+DECLARE_FD_DUMP_PROTOTYPE(fd_servers_dump)
 {
 	struct fd_list * li, *cli;
-	
-	fd_log_debug("Dumping servers list :");
+	size_t o=0;
+	if (!offset)
+		offset = &o;
+	
 	for (li = FD_SERVERS.next; li != &FD_SERVERS; li = li->next) {
 		struct server * s = (struct server *)li;
 		enum s_state st = get_status(s);
-		fd_log_debug("  Serv %p '%s': %s, %s, %s", 
-				s, fd_cnx_getid(s->conn), 
+		
+		CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "{server}(@%p)'%s': %s, %s, %s\n", s, fd_cnx_getid(s->conn), 
 				IPPROTO_NAME( s->proto ),
 				s->secur ? "Secur" : "NotSecur",
@@ -109,5 +111,5 @@
 				((st == RUNNING) ? "Thread running" :
 				((st == TERMINATED) ? "Thread terminated" :
-							  "Thread status unknown")));
+							  "Thread status unknown"))), return NULL);
 		/* Dump the client list of this server */
 		CHECK_POSIX_DO( pthread_mutex_lock(&s->clients_mtx), );
@@ -115,10 +117,10 @@
 			struct client * c = (struct client *)cli;
 			char bufts[128];
-			fd_log_debug("     Connected: '%s' (timeout: %s)",
-					fd_cnx_getid(c->conn),
-					fd_log_time(&c->ts, bufts, sizeof(bufts)));
+			CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "  {client}(@%p)'%s': to:%s\n", c, fd_cnx_getid(c->conn), fd_log_time(&c->ts, bufts, sizeof(bufts))), break);
 		}
 		CHECK_POSIX_DO( pthread_mutex_unlock(&s->clients_mtx), );
 	}
+	
+	return *buf;
 }
 
@@ -393,7 +395,12 @@
 		}
 	}
-	if (TRACE_BOOL(FULL)){
-		fd_log_debug("  Local server address(es) :");
-		fd_ep_dump( 5, &fd_g_config->cnf_endpoints );
+	
+	{
+		char * buf = NULL;
+		size_t len = 0, offset = 0;
+		CHECK_MALLOC_DO( fd_dump_extend( &buf, &len, &offset , "Local server address(es): "), );
+		CHECK_MALLOC_DO( fd_ep_dump(  &buf, &len, &offset, 5, &fd_g_config->cnf_endpoints ), );
+		LOG_N("%s", buf ?: "Error dumping addresses");
+		free(buf);
 	}
 	return 0;
Index: libfdcore/tcp.c
===================================================================
--- libfdcore/tcp.c	(revision 965)
+++ libfdcore/tcp.c	(revision 1085)
@@ -124,4 +124,5 @@
 	int ret = 0;
 	int s;
+	char * buf = NULL; size_t len = 0;
 	
 	TRACE_ENTRY("%p %p %d", sock, sa, salen);
@@ -137,5 +138,6 @@
 	pthread_cleanup_push(fd_cleanup_socket, &s);
 	
-	TRACE_sSA(FD_LOG_DEBUG, FULL, "Attempting TCP connection with peer: ", sa, NI_NUMERICHOST | NI_NUMERICSERV, "..." );
+	LOG_D( "Attempting TCP connection to %s...", fd_sa_dump_node(&buf, &len, NULL, sa, NI_NUMERICHOST | NI_NUMERICSERV)?:"<error>" );
+	free(buf);
 	
 	/* Try connecting to the remote address */
