diff extensions/app_radgw/rgw_clients.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 4a9f08d6b6ba
children 2091bf698fb1
line wrap: on
line diff
--- a/extensions/app_radgw/rgw_clients.c	Sat Mar 09 16:55:20 2013 +0100
+++ b/extensions/app_radgw/rgw_clients.c	Tue Mar 12 17:23:37 2013 +0100
@@ -921,8 +921,8 @@
 	/* Dump the entry in debug mode */
 	if (TRACE_BOOL(FULL + 1 )) {
 		TRACE_DEBUG(FULL, "Adding %s:", (type == RGW_CLI_NAS) ? "NAS" : "PROXY"  );
-		TRACE_DEBUG_sSA(FULL, 	 "\tIP : ", ip_port, NI_NUMERICHOST | NI_NUMERICSERV, "" );
-		TRACE_DEBUG_BUFFER(FULL, "\tKey: [", *key, keylen, "]" );
+		TRACE_sSA(FD_LOG_DEBUG, FULL, 	 "\tIP : ", ip_port, NI_NUMERICHOST | NI_NUMERICSERV, "" );
+		TRACE_BUFFER(FD_LOG_DEBUG, FULL, "\tKey: [", *key, keylen, "]" );
 	}
 	
 	/* Lock the lists */
@@ -947,13 +947,13 @@
 			goto end;
 		}
 		
-		fd_log_debug("ERROR: Conflicting RADIUS clients descriptions!\n");
-		TRACE_DEBUG(NONE, "Previous entry: %s", (prev->type == RGW_CLI_NAS) ? "NAS" : "PROXY");
-		TRACE_DEBUG_sSA(NONE, 	 "\tIP : ", prev->sa, NI_NUMERICHOST | NI_NUMERICSERV, "" );
-		TRACE_DEBUG_BUFFER(NONE, "\tKey: [", prev->key.data, prev->key.len, "]" );
-		TRACE_DEBUG(NONE, "Conflicting entry: %s", (type == RGW_CLI_NAS) ? "NAS" : "PROXY");
-		TRACE_DEBUG_sSA(NONE, 	 "\tIP : ", ip_port, NI_NUMERICHOST | NI_NUMERICSERV, "" );
-		TRACE_DEBUG_BUFFER(NONE, "\tKey: [", *key, keylen, "]" );
+		fd_log_erre("ERROR: Conflicting RADIUS clients descriptions!\n");
+		TRACE_ERROR("Previous entry: %s", (prev->type == RGW_CLI_NAS) ? "NAS" : "PROXY");
+		TRACE_sSA(FD_LOG_ERROR, NONE, 	 "\tIP : ", prev->sa, NI_NUMERICHOST | NI_NUMERICSERV, "" );
+		TRACE_BUFFER(FD_LOG_ERROR, NONE, "\tKey: [", prev->key.data, prev->key.len, "]" );
+		TRACE_ERROR("Conflicting entry: %s", (type == RGW_CLI_NAS) ? "NAS" : "PROXY");
+		TRACE_sSA(FD_LOG_ERROR, NONE, 	 "\tIP : ", ip_port, NI_NUMERICHOST | NI_NUMERICSERV, "" );
+		TRACE_BUFFER(FD_LOG_ERROR, NONE, "\tKey: [", *key, keylen, "]" );
 	}
 end:
 	/* release the lists */
@@ -969,7 +969,8 @@
 	
 	for (ref = senti->next; ref != senti; ref = ref->next) {
 		client = (struct rgw_client *)ref;
-		TRACE_DEBUG_sSA(NONE, 	 "  - ", client->sa, NI_NUMERICHOST | NI_NUMERICSERV, (client->type == RGW_CLI_NAS) ? "" : " [PROXY]" );
+		/* TODO: use a fct param instead of hardcoded FD_LOG_DEBUG */
+		TRACE_sSA(FD_LOG_DEBUG, NONE, 	 "  - ", client->sa, NI_NUMERICHOST | NI_NUMERICSERV, (client->type == RGW_CLI_NAS) ? "" : " [PROXY]" );
 	}
 }
 
"Welcome to our mercurial repository"