[Asterisk-code-review] res config ldap: Remove extraneous line numbers from log mes... (asterisk[master])

Sean Bright asteriskteam at digium.com
Mon Feb 20 06:06:34 CST 2017


Sean Bright has uploaded a new change for review. ( https://gerrit.asterisk.org/5017 )

Change subject: res_config_ldap: Remove extraneous line numbers from log messages
......................................................................

res_config_ldap: Remove extraneous line numbers from log messages

Extraneous line numbers were being output in many log messages. These
have been removed.

Change-Id: Ice9efa3d252ee87f37fa8f5ea852fda482675431
---
M res/res_config_ldap.c
1 file changed, 18 insertions(+), 18 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/17/5017/1

diff --git a/res/res_config_ldap.c b/res/res_config_ldap.c
index 5362e92..c1b61b4 100644
--- a/res/res_config_ldap.c
+++ b/res/res_config_ldap.c
@@ -190,7 +190,7 @@
 		return 0;
 	}
 
-	ast_debug(2, "LINE(%d) semicolon_count_var: %s\n", __LINE__, var_value->value);
+	ast_debug(2, "semicolon_count_var: %s\n", var_value->value);
 
 	return semicolon_count_str(var_value->value);
 }
@@ -330,7 +330,7 @@
 			for (v = values; *v; v++) {
 				value = *v;
 				valptr = value->bv_val;
-				ast_debug(2, "LINE(%d) attribute_name: %s LDAP value: %s\n", __LINE__, attribute_name, valptr);
+				ast_debug(2, "attribute_name: %s LDAP value: %s\n", attribute_name, valptr);
 				if (is_realmed_password_attribute) {
 					if (!strncasecmp(valptr, "{md5}", 5)) {
 						valptr += 5;
@@ -467,7 +467,7 @@
 								delim_value = ast_strdup(valptr);
 
 								if ((delim_tot_count = semicolon_count_str(delim_value)) > 0) {
-									ast_debug(4, "LINE(%d) is delimited %d times: %s\n", __LINE__, delim_tot_count, delim_value);
+									ast_debug(4, "is delimited %d times: %s\n", delim_tot_count, delim_value);
 									is_delimited = 1;
 								}
 							}
@@ -477,11 +477,11 @@
 								/* for non-Static RealTime, first */
 
 								for (i = pos; !ast_strlen_zero(valptr + i); i++) {
-									ast_debug(4, "LINE(%d) DELIM pos: %d i: %d\n", __LINE__, pos, i);
+									ast_debug(4, "DELIM pos: %d i: %d\n", pos, i);
 									if (delim_value[i] == ';') {
 										delim_value[i] = '\0';
 
-										ast_debug(2, "LINE(%d) DELIM - attribute_name: %s value: %s pos: %d\n", __LINE__, attribute_name, &delim_value[pos], pos);
+										ast_debug(2, "DELIM - attribute_name: %s value: %s pos: %d\n", attribute_name, &delim_value[pos], pos);
 
 										if (prev) {
 											prev->next = ast_variable_new(attribute_name, &delim_value[pos], table_config->table_name);
@@ -499,9 +499,9 @@
 									}
 								}
 								if (ast_strlen_zero(valptr + i)) {
-									ast_debug(4, "LINE(%d) DELIM pos: %d i: %d delim_count: %d\n", __LINE__, pos, i, delim_count);
+									ast_debug(4, "DELIM pos: %d i: %d delim_count: %d\n", pos, i, delim_count);
 									/* Last delimited value */
-									ast_debug(4, "LINE(%d) DELIM - attribute_name: %s value: %s pos: %d\n", __LINE__, attribute_name, &delim_value[pos], pos);
+									ast_debug(4, "DELIM - attribute_name: %s value: %s pos: %d\n", attribute_name, &delim_value[pos], pos);
 									if (prev) {
 										prev->next = ast_variable_new(attribute_name, &delim_value[pos], table_config->table_name);
 										if (prev->next) {
@@ -517,14 +517,14 @@
 								ast_free(delim_value);
 								delim_value = NULL;
 
-								ast_debug(4, "LINE(%d) DELIM pos: %d i: %d\n", __LINE__, pos, i);
+								ast_debug(4, "DELIM pos: %d i: %d\n", pos, i);
 							} else {
 								/* not delimited */
 								if (delim_value) {
 									ast_free(delim_value);
 									delim_value = NULL;
 								}
-								ast_debug(2, "LINE(%d) attribute_name: %s value: %s\n", __LINE__, attribute_name, valptr);
+								ast_debug(2, "attribute_name: %s value: %s\n", attribute_name, valptr);
 
 								if (prev) {
 									prev->next = ast_variable_new(attribute_name, valptr, table_config->table_name);
@@ -548,7 +548,7 @@
 					const struct ast_variable *tmpdebug = variable_named(var, "variable_name");
 					const struct ast_variable *tmpdebug2 = variable_named(var, "variable_value");
 					if (tmpdebug && tmpdebug2) {
-						ast_debug(3, "LINE(%d) Added to vars - %s = %s\n", __LINE__, tmpdebug->value, tmpdebug2->value);
+						ast_debug(3, "Added to vars - %s = %s\n", tmpdebug->value, tmpdebug2->value);
 					}
 				}
 				vars[entry_index++] = var;
@@ -559,7 +559,7 @@
 		} while (delim_count <= delim_tot_count && static_table_config == table_config);
 
 		if (static_table_config != table_config) {
-			ast_debug(3, "LINE(%d) Added to vars - non static\n", __LINE__);
+			ast_debug(3, "Added to vars - non static\n");
 
 			vars[entry_index++] = var;
 			prev = NULL;
@@ -1244,7 +1244,7 @@
 	}
 
 	if (!attribute || !lookup) {
-		ast_log(LOG_WARNING, "LINE(%d): search parameters are empty.\n", __LINE__);
+		ast_log(LOG_WARNING, "Search parameters are empty.\n");
 		return -1;
 	}
 	ast_mutex_lock(&ldap_lock);
@@ -1280,7 +1280,7 @@
 	 * one parameter/value pair and delimit them with a semicolon */
 	newparam = convert_attribute_name_to_ldap(table_config, field->name);
 	if (!newparam) {
-		ast_log(LOG_WARNING, "LINE(%d): need at least one parameter to modify.\n", __LINE__);
+		ast_log(LOG_WARNING, "Need at least one parameter to modify.\n");
 		return -1;
 	}
 
@@ -1366,12 +1366,12 @@
 	}
 	/* Ready to update */
 	if ((num_entries = ldap_count_entries(ldapConn, ldap_result_msg)) > 0) {
-		ast_debug(3, "LINE(%d) Modifying %s=%s hits: %d\n", __LINE__, attribute, lookup, num_entries);
+		ast_debug(3, "Modifying %s=%s hits: %d\n", attribute, lookup, num_entries);
 		for (i = 0; option_debug > 2 && i < mods_size - 1; i++) {
 			if (ldap_mods[i]->mod_op != LDAP_MOD_DELETE) {
-				ast_debug(3, "LINE(%d) %s=%s \n", __LINE__, ldap_mods[i]->mod_type, ldap_mods[i]->mod_values[0]);
+				ast_debug(3, "%s=%s\n", ldap_mods[i]->mod_type, ldap_mods[i]->mod_values[0]);
 			} else {
-				ast_debug(3, "LINE(%d) deleting %s \n", __LINE__, ldap_mods[i]->mod_type);
+				ast_debug(3, "deleting %s\n", ldap_mods[i]->mod_type);
 			}
 		}
 		ldap_entry = ldap_first_entry(ldapConn, ldap_result_msg);
@@ -1464,7 +1464,7 @@
 	field = update_fields;
 	newparam = convert_attribute_name_to_ldap(table_config, field->name);
 	if (!newparam) {
-		ast_log(LOG_WARNING, "LINE(%d): need at least one parameter to modify.\n", __LINE__);
+		ast_log(LOG_WARNING, "Need at least one parameter to modify.\n");
 		ast_free(filter);
 		ast_free(clean_basedn);
 		return -1;
@@ -1544,7 +1544,7 @@
 	/* Ready to update */
 	if ((num_entries = ldap_count_entries(ldapConn, ldap_result_msg)) > 0) {
 		for (i = 0; option_debug > 2 && i < mods_size - 1; i++) {
-			ast_debug(3, "LINE(%d) %s=%s \n", __LINE__, ldap_mods[i]->mod_type, ldap_mods[i]->mod_values[0]);
+			ast_debug(3, "%s=%s\n", ldap_mods[i]->mod_type, ldap_mods[i]->mod_values[0]);
 		}
 
 		ldap_entry = ldap_first_entry(ldapConn, ldap_result_msg);

-- 
To view, visit https://gerrit.asterisk.org/5017
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ice9efa3d252ee87f37fa8f5ea852fda482675431
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>



More information about the asterisk-code-review mailing list