Browse code

select.c: logging: DBG->LM_DBG, ERR -> LM_ERR

Ovidiu Sas authored on 13/01/2015 15:26:55
Showing 1 changed files
... ...
@@ -99,7 +99,7 @@ int w_parse_select(char**p, select_t* sel)
99 99
 	sel->n=0;
100 100
 	while (isalpha((unsigned char)*(*p))) {
101 101
 		if (sel->n > MAX_SELECT_PARAMS -2) {
102
-			ERR("parse_select: select depth exceeds max\n");
102
+			LM_ERR("select depth exceeds max\n");
103 103
 			goto error;
104 104
 		}
105 105
 		name.s=(*p);
... ...
@@ -108,7 +108,7 @@ int w_parse_select(char**p, select_t* sel)
108 108
 		name.len=(*p)-name.s;
109 109
 		sel->params[sel->n].type=SEL_PARAM_STR;
110 110
 		sel->params[sel->n].v.s=name;
111
-		DBG("parse_select: part %d: %.*s\n", sel->n, sel->params[sel->n].v.s.len, sel->params[sel->n].v.s.s);
111
+		LM_DBG("part %d: %.*s\n", sel->n, sel->params[sel->n].v.s.len, sel->params[sel->n].v.s.s);
112 112
 		sel->n++;
113 113
 		if (*(*p)=='[') {
114 114
 			(*p)++; 
... ...
@@ -118,33 +118,33 @@ int w_parse_select(char**p, select_t* sel)
118 118
 				name.s=(*p);
119 119
 				while ((*(*p)!='\0') && (*(*p)!='"')) (*p)++;
120 120
 				if (*(*p)!='"') {
121
-					ERR("parse_select: end of string is missing\n");
121
+					LM_ERR("end of string is missing\n");
122 122
 					goto error;
123 123
 				}
124 124
 				name.len=(*p)-name.s;
125 125
 				if (*((*p)-1)=='\\') name.len--;
126 126
 				(*p)++;
127 127
 				if (*(*p)!=']') {
128
-					ERR("parse_select: invalid string index, no closing ]\n");
128
+					LM_ERR("invalid string index, no closing ]\n");
129 129
 					goto error;
130 130
 				};
131 131
 				(*p)++;
132 132
 				sel->params[sel->n].type=SEL_PARAM_STR;
133 133
 				sel->params[sel->n].v.s=name;
134
-				DBG("parse_select: part %d: [\"%.*s\"]\n", sel->n, sel->params[sel->n].v.s.len, sel->params[sel->n].v.s.s);
134
+				LM_DBG("part %d: [\"%.*s\"]\n", sel->n, sel->params[sel->n].v.s.len, sel->params[sel->n].v.s.s);
135 135
 			} else {
136 136
 				name.s=(*p);
137 137
 				if (*(*p)=='-') (*p)++;
138 138
 				while (isdigit((unsigned char)*(*p))) (*p)++;
139 139
 				name.len=(*p)-name.s;
140 140
 				if (*(*p)!=']') {
141
-					ERR("parse_select: invalid index, no closing ]\n");
141
+					LM_ERR("invalid index, no closing ]\n");
142 142
 					goto error;
143 143
 				};
144 144
 				(*p)++;
145 145
 				sel->params[sel->n].type=SEL_PARAM_INT;
146 146
 				sel->params[sel->n].v.i=atoi(name.s);
147
-				DBG("parse_select: part %d: [%d]\n", sel->n, sel->params[sel->n].v.i);
147
+				LM_DBG("part %d: [%d]\n", sel->n, sel->params[sel->n].v.i);
148 148
 			}
149 149
 			sel->n++;
150 150
 		}
... ...
@@ -152,12 +152,12 @@ int w_parse_select(char**p, select_t* sel)
152 152
 		(*p)++;
153 153
 	};
154 154
 	if (sel->n==0) {
155
-		ERR("parse_select: invalid select '%.*s'\n", (int)(*p - select_name), select_name);
155
+		LM_ERR("invalid select '%.*s'\n", (int)(*p - select_name), select_name);
156 156
 		goto error;
157 157
 	};
158
-	DBG("parse_select: end, total elements: %d, calling resolve_select\n", sel->n);
158
+	LM_DBG("end, total elements: %d, calling resolve_select\n", sel->n);
159 159
 	if (resolve_select(sel)<0) {
160
-		ERR("parse_select: error while resolve_select '%.*s'\n", (int)(*p - select_name), select_name);
160
+		LM_ERR("error while resolve_select '%.*s'\n", (int)(*p - select_name), select_name);
161 161
 		goto error;
162 162
 	}
163 163
 	return 0;
... ...
@@ -203,7 +203,7 @@ int parse_select (char** p, select_t** s)
203 203
 	
204 204
 	sel=(select_t*)pkg_malloc(sizeof(select_t));
205 205
 	if (!sel) {
206
-		ERR("parse_select: no free memory\n");
206
+		LM_ERR("no free memory\n");
207 207
 		return -1;
208 208
 	}
209 209
 	memset(sel, 0, sizeof(select_t));
... ...
@@ -233,7 +233,7 @@ int shm_parse_select (char** p, select_t** s)
233 233
 	
234 234
 	sel=(select_t*)shm_malloc(sizeof(select_t));
235 235
 	if (!sel) {
236
-		ERR("parse_select: no free shared memory\n");
236
+		LM_ERR("no free shared memory\n");
237 237
 		return -1;
238 238
 	}
239 239
 	if (w_parse_select(p, sel)<0) {
... ...
@@ -260,10 +260,10 @@ int resolve_select(select_t* s)
260 260
 		accept = 0;
261 261
 		switch (s->params[param_idx].type) {
262 262
 		case SEL_PARAM_STR:
263
-			DBG("resolve_select: '%.*s'\n", s->params[param_idx].v.s.len, s->params[param_idx].v.s.s);
263
+			LM_DBG("'%.*s'\n", s->params[param_idx].v.s.len, s->params[param_idx].v.s.s);
264 264
 			break;
265 265
 		case SEL_PARAM_INT:
266
-			DBG("resolve_select: [%d]\n", s->params[param_idx].v.i);
266
+			LM_DBG("[%d]\n", s->params[param_idx].v.i);
267 267
 			break;
268 268
 		default:
269 269
 			/* just to avoid the warning */
... ...
@@ -409,7 +409,7 @@ int run_select(str* res, select_t* s, struct sip_msg* msg)
409 409
 		BUG("Select structure has not been resolved\n");
410 410
 		return -1;
411 411
 	}
412
-	DBG("Calling SELECT %p \n", s->f);
412
+	LM_DBG("Calling SELECT %p\n", s->f);
413 413
 
414 414
 	/* reset the uri pointer */
415 415
 	select_uri_p = NULL;
... ...
@@ -447,7 +447,7 @@ int register_select_table(select_row_t* mod_tab)
447 447
 	select_table_t* t;
448 448
 	t=(select_table_t*)pkg_malloc(sizeof(select_table_t));
449 449
 	if (!t) {
450
-		ERR("No memory for new select_table structure\n");
450
+		LM_ERR("No memory for new select_table structure\n");
451 451
 		return -1;
452 452
 	}
453 453