Browse code

sr_module.c: logging: convert LOG to LM_*

Ovidiu Sas authored on 04/10/2014 01:44:56
Showing 1 changed files
... ...
@@ -290,7 +290,7 @@ static int register_module(unsigned ver, union module_exports_u* e,
290 290
 
291 291
 	/* add module to the list */
292 292
 	if ((mod=pkg_malloc(sizeof(struct sr_module)))==0){
293
-		LOG(L_ERR, "load_module: memory allocation failure\n");
293
+		LM_ERR("memory allocation failure\n");
294 294
 		ret=E_OUT_OF_MEM;
295 295
 		goto error;
296 296
 	}
... ...
@@ -305,7 +305,7 @@ static int register_module(unsigned ver, union module_exports_u* e,
305 305
 		if (e->v0.cmds) {
306 306
 			mod->exports.cmds = sr_cmd_exports_convert(ver, e->v0.cmds, mod);
307 307
 			if (mod->exports.cmds == 0) {
308
-				ERR("failed to convert module command exports to 3.1 format"
308
+				LM_ERR("failed to convert module command exports to 3.1 format"
309 309
 						" for module \"%s\" (%s), interface version %d\n",
310 310
 						mod->exports.name, mod->path, ver);
311 311
 				ret = E_UNSPEC;
... ...
@@ -327,7 +327,7 @@ static int register_module(unsigned ver, union module_exports_u* e,
327 327
 		if (e->v1.cmds) {
328 328
 			mod->exports.cmds = sr_cmd_exports_convert(ver, e->v1.cmds, mod);
329 329
 			if (mod->exports.cmds == 0) {
330
-				ERR("failed to convert module command exports to 3.1 format"
330
+				LM_ERR("failed to convert module command exports to 3.1 format"
331 331
 						" for module \"%s\" (%s), interface version %d\n",
332 332
 						mod->exports.name, mod->path, ver);
333 333
 				ret = E_UNSPEC;
... ...
@@ -347,7 +347,7 @@ static int register_module(unsigned ver, union module_exports_u* e,
347 347
 		mod->exports.items = e->v1.items;
348 348
 		mod->exports.procs = e->v1.procs;
349 349
 	} else {
350
-		ERR("unsupported module interface version %d\n", ver);
350
+		LM_ERR("unsupported module interface version %d\n", ver);
351 351
 		ret = E_UNSPEC;
352 352
 		goto error;
353 353
 	}
... ...
@@ -366,12 +366,12 @@ static int register_module(unsigned ver, union module_exports_u* e,
366 366
 		/* register rpcs for ser modules */
367 367
 		i=rpc_register_array(mod->exports.rpc_methods);
368 368
 		if (i<0){
369
-			ERR("failed to register RPCs for module %s (%s)\n",
369
+			LM_ERR("failed to register RPCs for module %s (%s)\n",
370 370
 					mod->exports.name, path);
371 371
 			ret = E_UNSPEC;
372 372
 			goto error;
373 373
 		}else if (i>0){
374
-			ERR("%d duplicate RPCs name detected while registering RPCs"
374
+			LM_ERR("%d duplicate RPCs name detected while registering RPCs"
375 375
 					" declared in module %s (%s)\n",
376 376
 					i, mod->exports.name, path);
377 377
 			ret = E_UNSPEC;
... ...
@@ -417,22 +417,20 @@ static inline int version_control(void *handle, char *path)
417 417
 
418 418
 	m_ver=(char **)dlsym(handle, DLSYM_PREFIX "module_version");
419 419
 	if ((error=(char *)dlerror())!=0) {
420
-		LOG(L_ERR, "ERROR: no version info in module <%s>: %s\n",
421
-			path, error );
420
+		LM_ERR("no version info in module <%s>: %s\n", path, error);
422 421
 		return 0;
423 422
 	}
424 423
 	m_flags=(char **)dlsym(handle, DLSYM_PREFIX "module_flags");
425 424
 	if ((error=(char *)dlerror())!=0) {
426
-		LOG(L_ERR, "ERROR: no compile flags info in module <%s>: %s\n",
427
-			path, error );
425
+		LM_ERR("no compile flags info in module <%s>: %s\n", path, error);
428 426
 		return 0;
429 427
 	}
430 428
 	if (!m_ver || !(*m_ver)) {
431
-		LOG(L_ERR, "ERROR: no version in module <%s>\n", path );
429
+		LM_ERR("no version in module <%s>\n", path );
432 430
 		return 0;
433 431
 	}
434 432
 	if (!m_flags || !(*m_flags)) {
435
-		LOG(L_ERR, "ERROR: no compile flags in module <%s>\n", path );
433
+		LM_ERR("no compile flags in module <%s>\n", path );
436 434
 		return 0;
437 435
 	}
438 436
 
... ...
@@ -440,13 +438,13 @@ static inline int version_control(void *handle, char *path)
440 440
 		if (strcmp(SER_COMPILE_FLAGS, *m_flags)==0)
441 441
 			return 1;
442 442
 		else {
443
-			LOG(L_ERR, "ERROR: module compile flags mismatch for %s "
443
+			LM_ERR("module compile flags mismatch for %s "
444 444
 						" \ncore: %s \nmodule: %s\n",
445 445
 						path, SER_COMPILE_FLAGS, *m_flags);
446 446
 			return 0;
447 447
 		}
448 448
 	}
449
-	LOG(L_ERR, "ERROR: module version mismatch for %s; "
449
+	LM_ERR("module version mismatch for %s; "
450 450
 		"core: %s; module: %s\n", path, SER_FULL_VERSION, *m_ver );
451 451
 	return 0;
452 452
 }
... ...
@@ -584,8 +582,8 @@ int load_module(char* mod_path)
584 584
 			mdir=nxt_mdir?nxt_mdir+1:0;
585 585
 		}while(path==0 && mdir);
586 586
 		if (path==0){
587
-			LOG(L_ERR, "ERROR: load_module: could not find module <%.*s> in"
588
-						" <%s>\n", modname.len, modname.s, mods_dir);
587
+			LM_ERR("could not find module <%.*s> in <%s>\n",
588
+						modname.len, modname.s, mods_dir);
589 589
 			goto error;
590 590
 		}
591 591
 	}
... ...
@@ -596,15 +594,13 @@ int load_module(char* mod_path)
596 596
 reload:
597 597
 	handle=dlopen(path, dlflags); /* resolve all symbols now */
598 598
 	if (handle==0){
599
-		LOG(L_ERR, "ERROR: load_module: could not open module <%s>: %s\n",
600
-			path, dlerror());
599
+		LM_ERR("could not open module <%s>: %s\n", path, dlerror());
601 600
 		goto error;
602 601
 	}
603 602
 
604 603
 	for(t=modules;t; t=t->next){
605 604
 		if (t->handle==handle){
606
-			LOG(L_WARN, "WARNING: load_module: attempting to load the same"
607
-						" module twice (%s)\n", path);
605
+			LM_WARN("attempting to load the same module twice (%s)\n", path);
608 606
 			goto skip;
609 607
 		}
610 608
 	}
... ...
@@ -615,8 +611,7 @@ reload:
615 615
 	mod_if_ver = (unsigned *)dlsym(handle,
616 616
 									DLSYM_PREFIX "module_interface_ver");
617 617
 	if ( (error =(char*)dlerror())!=0 ){
618
-		LOG(L_ERR, "ERROR: no module interface version in module <%s>\n",
619
-					path );
618
+		LM_ERR("no module interface version in module <%s>\n", path );
620 619
 		goto error1;
621 620
 	}
622 621
 	/* launch register */
... ...
@@ -625,7 +620,7 @@ reload:
625 625
 		/* no error call it */
626 626
 		new_dlflags=dlflags;
627 627
 		if (mr(path, &new_dlflags, 0, 0)!=0) {
628
-			LOG(L_ERR, "ERROR: load_module: %s: mod_register failed\n", path);
628
+			LM_ERR("%s: mod_register failed\n", path);
629 629
 			goto error1;
630 630
 		}
631 631
 		if (new_dlflags!=dlflags && new_dlflags!=0) {
... ...
@@ -634,14 +629,13 @@ reload:
634 634
 			dlflags=new_dlflags;
635 635
 			retries--;
636 636
 			if (retries>0) goto reload;
637
-			LOG(L_ERR, "ERROR: load_module: %s: cannot agree"
638
-					" on the dlflags\n", path);
637
+			LM_ERR("%s: cannot agree on the dlflags\n", path);
639 638
 			goto error;
640 639
 		}
641 640
 	}
642 641
 	exp = (union module_exports_u*)dlsym(handle, DLSYM_PREFIX "exports");
643 642
 	if ( (error =(char*)dlerror())!=0 ){
644
-		LOG(L_ERR, "ERROR: load_module: %s\n", error);
643
+		LM_ERR("%s\n", error);
645 644
 		goto error1;
646 645
 	}
647 646
 	/* hack to allow for kamailio style dlflags inside exports */
... ...
@@ -656,8 +650,7 @@ reload:
656 656
 			dlflags=new_dlflags;
657 657
 			retries--;
658 658
 			if (retries>0) goto reload;
659
-			LOG(L_ERR, "ERROR: load_module: %s: cannot agree"
660
-					" on the dlflags\n", path);
659
+			LM_ERR("%s: cannot agree on the dlflags\n", path);
661 660
 			goto error;
662 661
 		}
663 662
 	}
... ...
@@ -849,8 +842,7 @@ int init_modules(void)
849 849
 	for(t = modules; t; t = t->next) {
850 850
 		if (t->exports.init_f) {
851 851
 			if (t->exports.init_f() != 0) {
852
-				LOG(L_ERR, "init_modules(): Error while"
853
-						" initializing module %s\n", t->exports.name);
852
+				LM_ERR("Error while initializing module %s\n", t->exports.name);
854 853
 				return -1;
855 854
 			}
856 855
 			/* delay next module init, if configured */
... ...
@@ -863,8 +855,8 @@ int init_modules(void)
863 863
 	mod_response_cbks=pkg_malloc(mod_response_cbk_no * 
864 864
 									sizeof(response_function));
865 865
 	if (mod_response_cbks==0){
866
-		LOG(L_ERR, "init_modules(): memory allocation failure"
867
-					" for %d response_f callbacks\n", mod_response_cbk_no);
866
+		LM_ERR("memory allocation failure for %d response_f callbacks\n",
867
+					mod_response_cbk_no);
868 868
 		return -1;
869 869
 	}
870 870
 	for (t=modules, i=0; t && (i<mod_response_cbk_no); t=t->next) {
... ...
@@ -901,8 +893,7 @@ int init_child(int rank)
901 901
 	for(t = modules; t; t = t->next) {
902 902
 		if (t->exports.init_child_f) {
903 903
 			if ((t->exports.init_child_f(rank)) < 0) {
904
-				LOG(L_ERR, "init_child(): Initialization of child"
905
-							" %d failed\n", rank);
904
+				LM_ERR("Initialization of child %d failed\n", rank);
906 905
 				return -1;
907 906
 			}
908 907
 		}
... ...
@@ -928,8 +919,7 @@ static int init_mod_child( struct sr_module* m, int rank )
928 928
 		if (m->exports.init_child_f) {
929 929
 			DBG("DEBUG: init_mod_child (%d): %s\n", rank, m->exports.name);
930 930
 			if (m->exports.init_child_f(rank)<0) {
931
-				LOG(L_ERR, "init_mod_child(): Error while"
932
-							" initializing module %s (%s)\n",
931
+				LM_ERR("Error while initializing module %s (%s)\n",
933 932
 							m->exports.name, m->path);
934 933
 				return -1;
935 934
 			} else {
... ...
@@ -974,8 +964,7 @@ static int init_mod( struct sr_module* m )
974 974
 			if (m->exports.init_f) {
975 975
 				DBG("DEBUG: init_mod: %s\n", m->exports.name);
976 976
 				if (m->exports.init_f()!=0) {
977
-					LOG(L_ERR, "init_mod(): Error while initializing"
978
-								" module %s (%s)\n",
977
+					LM_ERR("Error while initializing module %s (%s)\n",
979 978
 								m->exports.name, m->path);
980 979
 					return -1;
981 980
 				} else {
... ...
@@ -1013,8 +1002,7 @@ int init_modules(void)
1013 1013
 	mod_response_cbks=pkg_malloc(mod_response_cbk_no * 
1014 1014
 									sizeof(response_function));
1015 1015
 	if (mod_response_cbks==0){
1016
-		LOG(L_ERR, "init_modules(): memory allocation failure"
1017
-					" for %d response_f callbacks\n", mod_response_cbk_no);
1016
+		LM_ERR("memory allocation failure for %d response_f callbacks\n", mod_response_cbk_no);
1018 1017
 		return -1;
1019 1018
 	}
1020 1019
 	for (t=modules, i=0; t && (i<mod_response_cbk_no); t=t->next)
... ...
@@ -1089,7 +1077,7 @@ int fix_flag( modparam_t type, void* val,
1089 1089
 	char *p;
1090 1090
 
1091 1091
 	if ((type & PARAM_STRING)==0){
1092
-		LOG(L_CRIT, "BUG: %s: fix_flag(%s): bad parameter type\n",
1092
+		LM_CRIT("%s: fix_flag(%s): bad parameter type\n",
1093 1093
 					mod_name, param_name);
1094 1094
 		return -1;
1095 1095
 	}
... ...
@@ -1104,8 +1092,8 @@ int fix_flag( modparam_t type, void* val,
1104 1104
 		if (p){
1105 1105
 			f= str2s(p+1, strlen(p+1), &err);
1106 1106
 			if (err!=0){
1107
-				LOG(L_ERR, "ERROR: %s: invalid %s format:"
1108
-						" \"%s\"", mod_name, param_name, s);
1107
+				LM_ERR("%s: invalid %s format: \"%s\"",
1108
+						mod_name, param_name, s);
1109 1109
 				return -1;
1110 1110
 			}
1111 1111
 			*p=0;
... ...
@@ -1115,10 +1103,10 @@ int fix_flag( modparam_t type, void* val,
1115 1115
 			num=register_flag(s, f);
1116 1116
 		}
1117 1117
 		if (num<0){
1118
-			LOG(L_ERR, "ERROR: %s: bad %s %s\n", mod_name, param_name, s);
1118
+			LM_ERR("%s: bad %s %s\n", mod_name, param_name, s);
1119 1119
 			return -1;
1120 1120
 		} else if ((f>0) && (num!=f)){
1121
-			LOG(L_ERR, "WARNING: %s: flag %s already defined"
1121
+			LM_ERR("%s: flag %s already defined"
1122 1122
 					" as %d (and not %d), using %s:%d\n",
1123 1123
 					mod_name, s, num, f, s, num);
1124 1124
 		}
... ...
@@ -1150,7 +1138,7 @@ int fix_param(int type, void** param)
1150 1150
 
1151 1151
 	p = (fparam_t*)pkg_malloc(sizeof(fparam_t));
1152 1152
 	if (!p) {
1153
-		ERR("No memory left\n");
1153
+		LM_ERR("No memory left\n");
1154 1154
 		return E_OUT_OF_MEM;
1155 1155
 	}
1156 1156
 	memset(p, 0, sizeof(fparam_t));
... ...
@@ -1158,7 +1146,7 @@ int fix_param(int type, void** param)
1158 1158
 	
1159 1159
 	switch(type) {
1160 1160
 		case FPARAM_UNSPEC:
1161
-			ERR("Invalid type value\n");
1161
+			LM_ERR("Invalid type value\n");
1162 1162
 			goto error;
1163 1163
 		case FPARAM_STRING:
1164 1164
 			p->v.asciiz = *param;
... ...
@@ -1183,7 +1171,7 @@ int fix_param(int type, void** param)
1183 1183
 			break;
1184 1184
 		case FPARAM_REGEX:
1185 1185
 			if ((p->v.regex = pkg_malloc(sizeof(regex_t))) == 0) {
1186
-				ERR("No memory left\n");
1186
+				LM_ERR("No memory left\n");
1187 1187
 				goto error;
1188 1188
 			}
1189 1189
 			if (regcomp(p->v.regex, *param,
... ...
@@ -1220,7 +1208,7 @@ int fix_param(int type, void** param)
1220 1220
 				goto no_match;
1221 1221
 			}
1222 1222
 			if (parse_select(&name.s, &p->v.select) < 0) {
1223
-				ERR("Error while parsing select identifier\n");
1223
+				LM_ERR("Error while parsing select identifier\n");
1224 1224
 				goto error;
1225 1225
 			}
1226 1226
 			p->fixed = &p->v;
... ...
@@ -1230,7 +1218,7 @@ int fix_param(int type, void** param)
1230 1230
 			s.len = strlen(s.s);
1231 1231
 			p->v.subst = subst_parser(&s);
1232 1232
 			if (!p->v.subst) {
1233
-				ERR("Error while parsing regex substitution\n");
1233
+				LM_ERR("Error while parsing regex substitution\n");
1234 1234
 				goto error;
1235 1235
 			}
1236 1236
 			p->fixed = &p->v;
... ...
@@ -1245,7 +1233,7 @@ int fix_param(int type, void** param)
1245 1245
 			}
1246 1246
 			p->v.pvs=pkg_malloc(sizeof(pv_spec_t));
1247 1247
 			if (p->v.pvs==0){
1248
-				ERR("out of memory while parsing pv_spec_t\n");
1248
+				LM_ERR("out of memory while parsing pv_spec_t\n");
1249 1249
 				goto error;
1250 1250
 			}
1251 1251
 			if (pv_parse_spec2(&name, p->v.pvs, 1)==0){
... ...
@@ -1260,7 +1248,7 @@ int fix_param(int type, void** param)
1260 1260
 			name.s = (char*)*param;
1261 1261
 			name.len = strlen(name.s);
1262 1262
 			if (pv_parse_format(&name, &p->v.pve)<0){
1263
-				ERR("bad PVE format: \"%.*s\"\n", name.len, name.s);
1263
+				LM_ERR("bad PVE format: \"%.*s\"\n", name.len, name.s);
1264 1264
 				goto error;
1265 1265
 			}
1266 1266
 			p->fixed = &p->v;
... ...
@@ -1409,7 +1397,7 @@ int fixup_var_str_12(void** param, int param_no)
1409 1409
 		if ((ret = fix_param(FPARAM_SELECT, param)) <= 0) return ret;
1410 1410
 	}
1411 1411
 	if ((ret = fix_param(FPARAM_STR, param)) <= 0) return ret;
1412
-	ERR("Error while fixing parameter, PV, AVP, SELECT, and str conversions"
1412
+	LM_ERR("Error while fixing parameter, PV, AVP, SELECT, and str conversions"
1413 1413
 			" failed\n");
1414 1414
 	return -1;
1415 1415
 }
... ...
@@ -1461,7 +1449,7 @@ int fixup_var_pve_12(void** param, int param_no)
1461 1461
 		
1462 1462
 	}
1463 1463
 	if ((ret = fix_param(FPARAM_STR, param)) <= 0) return ret;
1464
-	ERR("Error while fixing parameter - PVE or str conversions failed\n");
1464
+	LM_ERR("Error while fixing parameter - PVE or str conversions failed\n");
1465 1465
 	return -1;
1466 1466
 }
1467 1467
 
... ...
@@ -1503,7 +1491,7 @@ int fixup_var_pve_str_12(void** param, int param_no)
1503 1503
 		
1504 1504
 	}
1505 1505
 	if ((ret = fix_param(FPARAM_STR, param)) <= 0) return ret;
1506
-	ERR("Error while fixing parameter, PV, AVP, SELECT, and str conversions"
1506
+	LM_ERR("Error while fixing parameter, PV, AVP, SELECT, and str conversions"
1507 1507
 			" failed\n");
1508 1508
 	return -1;
1509 1509
 }
... ...
@@ -1545,7 +1533,7 @@ int fixup_var_int_12(void** param, int param_no)
1545 1545
 		if ((ret = fix_param(FPARAM_SELECT, param)) <= 0) return ret;
1546 1546
 	}
1547 1547
 	if ((ret = fix_param(FPARAM_INT, param)) <= 0) return ret;
1548
-	ERR("Error while fixing parameter, PV, AVP, SELECT, and int conversions"
1548
+	LM_ERR("Error while fixing parameter, PV, AVP, SELECT, and int conversions"
1549 1549
 			" failed\n");
1550 1550
 	return -1;
1551 1551
 }
... ...
@@ -1574,7 +1562,7 @@ int fixup_regex_12(void** param, int param_no)
1574 1574
 	int ret;
1575 1575
 
1576 1576
 	if ((ret = fix_param(FPARAM_REGEX, param)) <= 0) return ret;
1577
-	ERR("Error while compiling regex in function parameter\n");
1577
+	LM_ERR("Error while compiling regex in function parameter\n");
1578 1578
 	return -1;
1579 1579
 }
1580 1580
 
... ...
@@ -1600,7 +1588,7 @@ int fixup_int_12(void** param, int param_no)
1600 1600
 	int ret;
1601 1601
 
1602 1602
 	if ((ret = fix_param(FPARAM_INT, param)) <= 0) return ret;
1603
-	ERR("Cannot function parameter to integer\n");
1603
+	LM_ERR("Cannot function parameter to integer\n");
1604 1604
 	return -1;
1605 1605
 
1606 1606
 }
... ...
@@ -1628,7 +1616,7 @@ int fixup_str_12(void** param, int param_no)
1628 1628
 	int ret;
1629 1629
 
1630 1630
 	if ((ret = fix_param(FPARAM_STR, param)) <= 0) return ret;
1631
-	ERR("Cannot function parameter to string\n");
1631
+	LM_ERR("Cannot function parameter to string\n");
1632 1632
 	return -1;
1633 1633
 }
1634 1634
 
... ...
@@ -1697,7 +1685,7 @@ int get_str_fparam(str* dst, struct sip_msg* msg, fparam_t* param)
1697 1697
 					   ((pv_val.flags&(PV_VAL_NULL|PV_VAL_STR))==PV_VAL_STR))){
1698 1698
 					*dst=pv_val.rs;
1699 1699
 			}else{
1700
-				ERR("Could not convert PV to str\n");
1700
+				LM_ERR("Could not convert PV to str\n");
1701 1701
 				return -1;
1702 1702
 			}
1703 1703
 			break;
... ...
@@ -1705,7 +1693,7 @@ int get_str_fparam(str* dst, struct sip_msg* msg, fparam_t* param)
1705 1705
 			dst->s=pv_get_buffer();
1706 1706
 			dst->len=pv_get_buffer_size();
1707 1707
 			if (unlikely(pv_printf(msg, param->v.pve, dst->s, &dst->len)!=0)){
1708
-				ERR("Could not convert the PV-formated string to str\n");
1708
+				LM_ERR("Could not convert the PV-formated string to str\n");
1709 1709
 				dst->len=0;
1710 1710
 				return -1;
1711 1711
 			};
... ...
@@ -1746,7 +1734,7 @@ int get_int_fparam(int* dst, struct sip_msg* msg, fparam_t* param)
1746 1746
 			}
1747 1747
 			if (avp->flags & AVP_VAL_STR) {
1748 1748
 				if (str2int(&val.s, (unsigned int*)dst) < 0) {
1749
-					ERR("Could not convert AVP string value to int\n");
1749
+					LM_ERR("Could not convert AVP string value to int\n");
1750 1750
 					return -1;
1751 1751
 				}
1752 1752
 			} else {
... ...
@@ -1757,7 +1745,7 @@ int get_int_fparam(int* dst, struct sip_msg* msg, fparam_t* param)
1757 1757
 			ret = run_select(&tmp, param->v.select, msg);
1758 1758
 			if (unlikely(ret < 0 || ret > 0)) return -1;
1759 1759
 			if (unlikely(str2int(&tmp, (unsigned int*)dst) < 0)) {
1760
-				ERR("Could not convert select result to int\n");
1760
+				LM_ERR("Could not convert select result to int\n");
1761 1761
 				return -1;
1762 1762
 			}
1763 1763
 			break;
... ...
@@ -1766,7 +1754,7 @@ int get_int_fparam(int* dst, struct sip_msg* msg, fparam_t* param)
1766 1766
 					   ((pv_val.flags&(PV_VAL_NULL|PV_VAL_INT))==PV_VAL_INT))){
1767 1767
 					*dst=pv_val.ri;
1768 1768
 			}else{
1769
-				ERR("Could not convert PV to int\n");
1769
+				LM_ERR("Could not convert PV to int\n");
1770 1770
 				return -1;
1771 1771
 			}
1772 1772
 			break;
... ...
@@ -1817,7 +1805,7 @@ int get_is_fparam(int* i_dst, str* s_dst, struct sip_msg* msg, fparam_t* param,
1817 1817
 				*s_dst = val.s;
1818 1818
 				*flags |= PARAM_STR;
1819 1819
 				if (str2int(&val.s, (unsigned int*)i_dst) < 0) {
1820
-					ERR("Could not convert AVP string value to int\n");
1820
+					LM_ERR("Could not convert AVP string value to int\n");
1821 1821
 					return -1;
1822 1822
 				}
1823 1823
 			} else {
... ...
@@ -1829,7 +1817,7 @@ int get_is_fparam(int* i_dst, str* s_dst, struct sip_msg* msg, fparam_t* param,
1829 1829
 			ret = run_select(&tmp, param->v.select, msg);
1830 1830
 			if (unlikely(ret < 0 || ret > 0)) return -1;
1831 1831
 			if (unlikely(str2int(&tmp, (unsigned int*)i_dst) < 0)) {
1832
-				ERR("Could not convert select result to int\n");
1832
+				LM_ERR("Could not convert select result to int\n");
1833 1833
 				return -1;
1834 1834
 			}
1835 1835
 			*flags |= PARAM_INT;
... ...
@@ -1845,7 +1833,7 @@ int get_is_fparam(int* i_dst, str* s_dst, struct sip_msg* msg, fparam_t* param,
1845 1845
 					*flags |= PARAM_STR;
1846 1846
 				}
1847 1847
 			}else{
1848
-				ERR("Could not get PV\n");
1848
+				LM_ERR("Could not get PV\n");
1849 1849
 				return -1;
1850 1850
 			}
1851 1851
 			break;
... ...
@@ -1853,7 +1841,7 @@ int get_is_fparam(int* i_dst, str* s_dst, struct sip_msg* msg, fparam_t* param,
1853 1853
 			s_dst->s=pv_get_buffer();
1854 1854
 			s_dst->len=pv_get_buffer_size();
1855 1855
 			if (unlikely(pv_printf(msg, param->v.pve, s_dst->s, &s_dst->len)!=0)){
1856
-				ERR("Could not convert the PV-formated string to str\n");
1856
+				LM_ERR("Could not convert the PV-formated string to str\n");
1857 1857
 				s_dst->len=0;
1858 1858
 				return -1;
1859 1859
 			}
... ...
@@ -1881,7 +1869,7 @@ int get_regex_fparam(regex_t *dst, struct sip_msg* msg, fparam_t* param)
1881 1881
 			*dst = *param->v.regex;
1882 1882
 			return 0;
1883 1883
 		default:
1884
-			ERR("unexpected parameter type (%d), instead of regexp.\n", 
1884
+			LM_ERR("unexpected parameter type (%d), instead of regexp.\n", 
1885 1885
 					param->type);
1886 1886
 	}
1887 1887
 	return -1;