diff libfdcore/sctp.c @ 965:9b37f34c1b1f

Some modifications to logging code: - Added a FD_LOG_NOTICE level for the logger function - Separated the internal debug levels (NONE, INFO, ...) from the "printlevel" for the logger - Renamed TRACE_DEBUG_ERROR to TRACE_ERROR for symetry - Renamed TRACE_DEBUG_BUFFER and TRACE_DEBUG_sSA. There take now the printlevel as parameter - Added new TRACE_NOTICE, fd_log_notice and fd_log_error macros. * sorry if I forgot some changes...
author Sebastien Decugis <sdecugis@freediameter.net>
date Tue, 12 Mar 2013 17:23:37 +0100
parents d95cd3ca9e8d
children 2091bf698fb1
line wrap: on
line diff
--- a/libfdcore/sctp.c	Sat Mar 09 16:55:20 2013 +0100
+++ b/libfdcore/sctp.c	Tue Mar 12 17:23:37 2013 +0100
@@ -747,7 +747,7 @@
 			ptr.sa = sar;
 			fd_log_debug("Calling sctp_bindx with the following address array:\n");
 			for (i = 0; i < count; i++) {
-				TRACE_DEBUG_sSA(FULL, "    - ", ptr.sa, NI_NUMERICHOST | NI_NUMERICSERV, "" );
+				TRACE_sSA(FD_LOG_DEBUG, FULL, "    - ", ptr.sa, NI_NUMERICHOST | NI_NUMERICSERV, "" );
 				ptr.buf += (ptr.sa->sa_family == AF_INET) ? sizeof(sSA4) : sizeof(sSA6) ;
 			}
 		}
@@ -775,7 +775,7 @@
 		
 		fd_log_debug("SCTP server bound on :\n");
 		for (ptr.sa = sar; sz-- > 0; ptr.buf += (ptr.sa->sa_family == AF_INET) ? sizeof(sSA4) : sizeof(sSA6)) {
-			TRACE_DEBUG_sSA(FULL, "    - ", ptr.sa, NI_NUMERICHOST | NI_NUMERICSERV, "" );
+			TRACE_sSA(FD_LOG_DEBUG, FULL, "    - ", ptr.sa, NI_NUMERICHOST | NI_NUMERICSERV, "" );
 		}
 		sctp_freeladdrs(sar);
 	}
@@ -841,7 +841,7 @@
 		int i;
 		ptr.buf = sar.buf;
 		for (i=0; i< count; i++) {
-			TRACE_DEBUG_sSA(FULL, "  - ", ptr.sa, NI_NUMERICHOST | NI_NUMERICSERV, "" );
+			TRACE_sSA(FD_LOG_DEBUG, FULL, "  - ", ptr.sa, NI_NUMERICHOST | NI_NUMERICSERV, "" );
 			ptr.buf += (ptr.sa->sa_family == AF_INET) ? sizeof(sSA4) : sizeof(sSA6);
 		}
 	}
@@ -1150,7 +1150,7 @@
 	
 			case SCTP_PEER_ADDR_CHANGE:
 				TRACE_DEBUG(FULL, "Received SCTP_PEER_ADDR_CHANGE notification");
-				TRACE_DEBUG_sSA(SCTP_LEVEL, "    intf_change : ", &(notif->sn_paddr_change.spc_aaddr), NI_NUMERICHOST | NI_NUMERICSERV, "" );
+				TRACE_sSA(FD_LOG_DEBUG, SCTP_LEVEL, "    intf_change : ", &(notif->sn_paddr_change.spc_aaddr), NI_NUMERICHOST | NI_NUMERICSERV, "" );
 				TRACE_DEBUG(SCTP_LEVEL, "          state : %d", notif->sn_paddr_change.spc_state);
 				TRACE_DEBUG(SCTP_LEVEL, "          error : %d", notif->sn_paddr_change.spc_error);
 				
"Welcome to our mercurial repository"