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 438
 		if (strcmp(SER_COMPILE_FLAGS, *m_flags)==0)
441 439
 			return 1;
442 440
 		else {
443
-			LOG(L_ERR, "ERROR: module compile flags mismatch for %s "
441
+			LM_ERR("module compile flags mismatch for %s "
444 442
 						" \ncore: %s \nmodule: %s\n",
445 443
 						path, SER_COMPILE_FLAGS, *m_flags);
446 444
 			return 0;
447 445
 		}
448 446
 	}
449
-	LOG(L_ERR, "ERROR: module version mismatch for %s; "
447
+	LM_ERR("module version mismatch for %s; "
450 448
 		"core: %s; module: %s\n", path, SER_FULL_VERSION, *m_ver );
451 449
 	return 0;
452 450
 }
... ...
@@ -584,8 +582,8 @@ int load_module(char* mod_path)
584 582
 			mdir=nxt_mdir?nxt_mdir+1:0;
585 583
 		}while(path==0 && mdir);
586 584
 		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);
585
+			LM_ERR("could not find module <%.*s> in <%s>\n",
586
+						modname.len, modname.s, mods_dir);
589 587
 			goto error;
590 588
 		}
591 589
 	}
... ...
@@ -596,15 +594,13 @@ int load_module(char* mod_path)
596 594
 reload:
597 595
 	handle=dlopen(path, dlflags); /* resolve all symbols now */
598 596
 	if (handle==0){
599
-		LOG(L_ERR, "ERROR: load_module: could not open module <%s>: %s\n",
600
-			path, dlerror());
597
+		LM_ERR("could not open module <%s>: %s\n", path, dlerror());
601 598
 		goto error;
602 599
 	}
603 600
 
604 601
 	for(t=modules;t; t=t->next){
605 602
 		if (t->handle==handle){
606
-			LOG(L_WARN, "WARNING: load_module: attempting to load the same"
607
-						" module twice (%s)\n", path);
603
+			LM_WARN("attempting to load the same module twice (%s)\n", path);
608 604
 			goto skip;
609 605
 		}
610 606
 	}
... ...
@@ -615,8 +611,7 @@ reload:
615 611
 	mod_if_ver = (unsigned *)dlsym(handle,
616 612
 									DLSYM_PREFIX "module_interface_ver");
617 613
 	if ( (error =(char*)dlerror())!=0 ){
618
-		LOG(L_ERR, "ERROR: no module interface version in module <%s>\n",
619
-					path );
614
+		LM_ERR("no module interface version in module <%s>\n", path );
620 615
 		goto error1;
621 616
 	}
622 617
 	/* launch register */
... ...
@@ -625,7 +620,7 @@ reload:
625 620
 		/* no error call it */
626 621
 		new_dlflags=dlflags;
627 622
 		if (mr(path, &new_dlflags, 0, 0)!=0) {
628
-			LOG(L_ERR, "ERROR: load_module: %s: mod_register failed\n", path);
623
+			LM_ERR("%s: mod_register failed\n", path);
629 624
 			goto error1;
630 625
 		}
631 626
 		if (new_dlflags!=dlflags && new_dlflags!=0) {
... ...
@@ -634,14 +629,13 @@ reload:
634 629
 			dlflags=new_dlflags;
635 630
 			retries--;
636 631
 			if (retries>0) goto reload;
637
-			LOG(L_ERR, "ERROR: load_module: %s: cannot agree"
638
-					" on the dlflags\n", path);
632
+			LM_ERR("%s: cannot agree on the dlflags\n", path);
639 633
 			goto error;
640 634
 		}
641 635
 	}
642 636
 	exp = (union module_exports_u*)dlsym(handle, DLSYM_PREFIX "exports");
643 637
 	if ( (error =(char*)dlerror())!=0 ){
644
-		LOG(L_ERR, "ERROR: load_module: %s\n", error);
638
+		LM_ERR("%s\n", error);
645 639
 		goto error1;
646 640
 	}
647 641
 	/* hack to allow for kamailio style dlflags inside exports */
... ...
@@ -656,8 +650,7 @@ reload:
656 650
 			dlflags=new_dlflags;
657 651
 			retries--;
658 652
 			if (retries>0) goto reload;
659
-			LOG(L_ERR, "ERROR: load_module: %s: cannot agree"
660
-					" on the dlflags\n", path);
653
+			LM_ERR("%s: cannot agree on the dlflags\n", path);
661 654
 			goto error;
662 655
 		}
663 656
 	}
... ...
@@ -849,8 +842,7 @@ int init_modules(void)
849 842
 	for(t = modules; t; t = t->next) {
850 843
 		if (t->exports.init_f) {
851 844
 			if (t->exports.init_f() != 0) {
852
-				LOG(L_ERR, "init_modules(): Error while"
853
-						" initializing module %s\n", t->exports.name);
845
+				LM_ERR("Error while initializing module %s\n", t->exports.name);
854 846
 				return -1;
855 847
 			}
856 848
 			/* delay next module init, if configured */
... ...
@@ -863,8 +855,8 @@ int init_modules(void)
863 855
 	mod_response_cbks=pkg_malloc(mod_response_cbk_no * 
864 856
 									sizeof(response_function));
865 857
 	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);
858
+		LM_ERR("memory allocation failure for %d response_f callbacks\n",
859
+					mod_response_cbk_no);
868 860
 		return -1;
869 861
 	}
870 862
 	for (t=modules, i=0; t && (i<mod_response_cbk_no); t=t->next) {
... ...
@@ -901,8 +893,7 @@ int init_child(int rank)
901 893
 	for(t = modules; t; t = t->next) {
902 894
 		if (t->exports.init_child_f) {
903 895
 			if ((t->exports.init_child_f(rank)) < 0) {
904
-				LOG(L_ERR, "init_child(): Initialization of child"
905
-							" %d failed\n", rank);
896
+				LM_ERR("Initialization of child %d failed\n", rank);
906 897
 				return -1;
907 898
 			}
908 899
 		}
... ...
@@ -928,8 +919,7 @@ static int init_mod_child( struct sr_module* m, int rank )
928 919
 		if (m->exports.init_child_f) {
929 920
 			DBG("DEBUG: init_mod_child (%d): %s\n", rank, m->exports.name);
930 921
 			if (m->exports.init_child_f(rank)<0) {
931
-				LOG(L_ERR, "init_mod_child(): Error while"
932
-							" initializing module %s (%s)\n",
922
+				LM_ERR("Error while initializing module %s (%s)\n",
933 923
 							m->exports.name, m->path);
934 924
 				return -1;
935 925
 			} else {
... ...
@@ -974,8 +964,7 @@ static int init_mod( struct sr_module* m )
974 964
 			if (m->exports.init_f) {
975 965
 				DBG("DEBUG: init_mod: %s\n", m->exports.name);
976 966
 				if (m->exports.init_f()!=0) {
977
-					LOG(L_ERR, "init_mod(): Error while initializing"
978
-								" module %s (%s)\n",
967
+					LM_ERR("Error while initializing module %s (%s)\n",
979 968
 								m->exports.name, m->path);
980 969
 					return -1;
981 970
 				} else {
... ...
@@ -1013,8 +1002,7 @@ int init_modules(void)
1013 1002
 	mod_response_cbks=pkg_malloc(mod_response_cbk_no * 
1014 1003
 									sizeof(response_function));
1015 1004
 	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);
1005
+		LM_ERR("memory allocation failure for %d response_f callbacks\n", mod_response_cbk_no);
1018 1006
 		return -1;
1019 1007
 	}
1020 1008
 	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 1077
 	char *p;
1090 1078
 
1091 1079
 	if ((type & PARAM_STRING)==0){
1092
-		LOG(L_CRIT, "BUG: %s: fix_flag(%s): bad parameter type\n",
1080
+		LM_CRIT("%s: fix_flag(%s): bad parameter type\n",
1093 1081
 					mod_name, param_name);
1094 1082
 		return -1;
1095 1083
 	}
... ...
@@ -1104,8 +1092,8 @@ int fix_flag( modparam_t type, void* val,
1104 1092
 		if (p){
1105 1093
 			f= str2s(p+1, strlen(p+1), &err);
1106 1094
 			if (err!=0){
1107
-				LOG(L_ERR, "ERROR: %s: invalid %s format:"
1108
-						" \"%s\"", mod_name, param_name, s);
1095
+				LM_ERR("%s: invalid %s format: \"%s\"",
1096
+						mod_name, param_name, s);
1109 1097
 				return -1;
1110 1098
 			}
1111 1099
 			*p=0;
... ...
@@ -1115,10 +1103,10 @@ int fix_flag( modparam_t type, void* val,
1115 1103
 			num=register_flag(s, f);
1116 1104
 		}
1117 1105
 		if (num<0){
1118
-			LOG(L_ERR, "ERROR: %s: bad %s %s\n", mod_name, param_name, s);
1106
+			LM_ERR("%s: bad %s %s\n", mod_name, param_name, s);
1119 1107
 			return -1;
1120 1108
 		} else if ((f>0) && (num!=f)){
1121
-			LOG(L_ERR, "WARNING: %s: flag %s already defined"
1109
+			LM_ERR("%s: flag %s already defined"
1122 1110
 					" as %d (and not %d), using %s:%d\n",
1123 1111
 					mod_name, s, num, f, s, num);
1124 1112
 		}
... ...
@@ -1150,7 +1138,7 @@ int fix_param(int type, void** param)
1150 1138
 
1151 1139
 	p = (fparam_t*)pkg_malloc(sizeof(fparam_t));
1152 1140
 	if (!p) {
1153
-		ERR("No memory left\n");
1141
+		LM_ERR("No memory left\n");
1154 1142
 		return E_OUT_OF_MEM;
1155 1143
 	}
1156 1144
 	memset(p, 0, sizeof(fparam_t));
... ...
@@ -1158,7 +1146,7 @@ int fix_param(int type, void** param)
1158 1146
 	
1159 1147
 	switch(type) {
1160 1148
 		case FPARAM_UNSPEC:
1161
-			ERR("Invalid type value\n");
1149
+			LM_ERR("Invalid type value\n");
1162 1150
 			goto error;
1163 1151
 		case FPARAM_STRING:
1164 1152
 			p->v.asciiz = *param;
... ...
@@ -1183,7 +1171,7 @@ int fix_param(int type, void** param)
1183 1171
 			break;
1184 1172
 		case FPARAM_REGEX:
1185 1173
 			if ((p->v.regex = pkg_malloc(sizeof(regex_t))) == 0) {
1186
-				ERR("No memory left\n");
1174
+				LM_ERR("No memory left\n");
1187 1175
 				goto error;
1188 1176
 			}
1189 1177
 			if (regcomp(p->v.regex, *param,
... ...
@@ -1220,7 +1208,7 @@ int fix_param(int type, void** param)
1220 1208
 				goto no_match;
1221 1209
 			}
1222 1210
 			if (parse_select(&name.s, &p->v.select) < 0) {
1223
-				ERR("Error while parsing select identifier\n");
1211
+				LM_ERR("Error while parsing select identifier\n");
1224 1212
 				goto error;
1225 1213
 			}
1226 1214
 			p->fixed = &p->v;
... ...
@@ -1230,7 +1218,7 @@ int fix_param(int type, void** param)
1230 1218
 			s.len = strlen(s.s);
1231 1219
 			p->v.subst = subst_parser(&s);
1232 1220
 			if (!p->v.subst) {
1233
-				ERR("Error while parsing regex substitution\n");
1221
+				LM_ERR("Error while parsing regex substitution\n");
1234 1222
 				goto error;
1235 1223
 			}
1236 1224
 			p->fixed = &p->v;
... ...
@@ -1245,7 +1233,7 @@ int fix_param(int type, void** param)
1245 1233
 			}
1246 1234
 			p->v.pvs=pkg_malloc(sizeof(pv_spec_t));
1247 1235
 			if (p->v.pvs==0){
1248
-				ERR("out of memory while parsing pv_spec_t\n");
1236
+				LM_ERR("out of memory while parsing pv_spec_t\n");
1249 1237
 				goto error;
1250 1238
 			}
1251 1239
 			if (pv_parse_spec2(&name, p->v.pvs, 1)==0){
... ...
@@ -1260,7 +1248,7 @@ int fix_param(int type, void** param)
1260 1248
 			name.s = (char*)*param;
1261 1249
 			name.len = strlen(name.s);
1262 1250
 			if (pv_parse_format(&name, &p->v.pve)<0){
1263
-				ERR("bad PVE format: \"%.*s\"\n", name.len, name.s);
1251
+				LM_ERR("bad PVE format: \"%.*s\"\n", name.len, name.s);
1264 1252
 				goto error;
1265 1253
 			}
1266 1254
 			p->fixed = &p->v;
... ...
@@ -1409,7 +1397,7 @@ int fixup_var_str_12(void** param, int param_no)
1409 1397
 		if ((ret = fix_param(FPARAM_SELECT, param)) <= 0) return ret;
1410 1398
 	}
1411 1399
 	if ((ret = fix_param(FPARAM_STR, param)) <= 0) return ret;
1412
-	ERR("Error while fixing parameter, PV, AVP, SELECT, and str conversions"
1400
+	LM_ERR("Error while fixing parameter, PV, AVP, SELECT, and str conversions"
1413 1401
 			" failed\n");
1414 1402
 	return -1;
1415 1403
 }
... ...
@@ -1461,7 +1449,7 @@ int fixup_var_pve_12(void** param, int param_no)
1461 1449
 		
1462 1450
 	}
1463 1451
 	if ((ret = fix_param(FPARAM_STR, param)) <= 0) return ret;
1464
-	ERR("Error while fixing parameter - PVE or str conversions failed\n");
1452
+	LM_ERR("Error while fixing parameter - PVE or str conversions failed\n");
1465 1453
 	return -1;
1466 1454
 }
1467 1455
 
... ...
@@ -1503,7 +1491,7 @@ int fixup_var_pve_str_12(void** param, int param_no)
1503 1491
 		
1504 1492
 	}
1505 1493
 	if ((ret = fix_param(FPARAM_STR, param)) <= 0) return ret;
1506
-	ERR("Error while fixing parameter, PV, AVP, SELECT, and str conversions"
1494
+	LM_ERR("Error while fixing parameter, PV, AVP, SELECT, and str conversions"
1507 1495
 			" failed\n");
1508 1496
 	return -1;
1509 1497
 }
... ...
@@ -1545,7 +1533,7 @@ int fixup_var_int_12(void** param, int param_no)
1545 1533
 		if ((ret = fix_param(FPARAM_SELECT, param)) <= 0) return ret;
1546 1534
 	}
1547 1535
 	if ((ret = fix_param(FPARAM_INT, param)) <= 0) return ret;
1548
-	ERR("Error while fixing parameter, PV, AVP, SELECT, and int conversions"
1536
+	LM_ERR("Error while fixing parameter, PV, AVP, SELECT, and int conversions"
1549 1537
 			" failed\n");
1550 1538
 	return -1;
1551 1539
 }
... ...
@@ -1574,7 +1562,7 @@ int fixup_regex_12(void** param, int param_no)
1574 1562
 	int ret;
1575 1563
 
1576 1564
 	if ((ret = fix_param(FPARAM_REGEX, param)) <= 0) return ret;
1577
-	ERR("Error while compiling regex in function parameter\n");
1565
+	LM_ERR("Error while compiling regex in function parameter\n");
1578 1566
 	return -1;
1579 1567
 }
1580 1568
 
... ...
@@ -1600,7 +1588,7 @@ int fixup_int_12(void** param, int param_no)
1600 1588
 	int ret;
1601 1589
 
1602 1590
 	if ((ret = fix_param(FPARAM_INT, param)) <= 0) return ret;
1603
-	ERR("Cannot function parameter to integer\n");
1591
+	LM_ERR("Cannot function parameter to integer\n");
1604 1592
 	return -1;
1605 1593
 
1606 1594
 }
... ...
@@ -1628,7 +1616,7 @@ int fixup_str_12(void** param, int param_no)
1628 1616
 	int ret;
1629 1617
 
1630 1618
 	if ((ret = fix_param(FPARAM_STR, param)) <= 0) return ret;
1631
-	ERR("Cannot function parameter to string\n");
1619
+	LM_ERR("Cannot function parameter to string\n");
1632 1620
 	return -1;
1633 1621
 }
1634 1622
 
... ...
@@ -1697,7 +1685,7 @@ int get_str_fparam(str* dst, struct sip_msg* msg, fparam_t* param)
1697 1685
 					   ((pv_val.flags&(PV_VAL_NULL|PV_VAL_STR))==PV_VAL_STR))){
1698 1686
 					*dst=pv_val.rs;
1699 1687
 			}else{
1700
-				ERR("Could not convert PV to str\n");
1688
+				LM_ERR("Could not convert PV to str\n");
1701 1689
 				return -1;
1702 1690
 			}
1703 1691
 			break;
... ...
@@ -1705,7 +1693,7 @@ int get_str_fparam(str* dst, struct sip_msg* msg, fparam_t* param)
1705 1693
 			dst->s=pv_get_buffer();
1706 1694
 			dst->len=pv_get_buffer_size();
1707 1695
 			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");
1696
+				LM_ERR("Could not convert the PV-formated string to str\n");
1709 1697
 				dst->len=0;
1710 1698
 				return -1;
1711 1699
 			};
... ...
@@ -1746,7 +1734,7 @@ int get_int_fparam(int* dst, struct sip_msg* msg, fparam_t* param)
1746 1734
 			}
1747 1735
 			if (avp->flags & AVP_VAL_STR) {
1748 1736
 				if (str2int(&val.s, (unsigned int*)dst) < 0) {
1749
-					ERR("Could not convert AVP string value to int\n");
1737
+					LM_ERR("Could not convert AVP string value to int\n");
1750 1738
 					return -1;
1751 1739
 				}
1752 1740
 			} else {
... ...
@@ -1757,7 +1745,7 @@ int get_int_fparam(int* dst, struct sip_msg* msg, fparam_t* param)
1757 1745
 			ret = run_select(&tmp, param->v.select, msg);
1758 1746
 			if (unlikely(ret < 0 || ret > 0)) return -1;
1759 1747
 			if (unlikely(str2int(&tmp, (unsigned int*)dst) < 0)) {
1760
-				ERR("Could not convert select result to int\n");
1748
+				LM_ERR("Could not convert select result to int\n");
1761 1749
 				return -1;
1762 1750
 			}
1763 1751
 			break;
... ...
@@ -1766,7 +1754,7 @@ int get_int_fparam(int* dst, struct sip_msg* msg, fparam_t* param)
1766 1754
 					   ((pv_val.flags&(PV_VAL_NULL|PV_VAL_INT))==PV_VAL_INT))){
1767 1755
 					*dst=pv_val.ri;
1768 1756
 			}else{
1769
-				ERR("Could not convert PV to int\n");
1757
+				LM_ERR("Could not convert PV to int\n");
1770 1758
 				return -1;
1771 1759
 			}
1772 1760
 			break;
... ...
@@ -1817,7 +1805,7 @@ int get_is_fparam(int* i_dst, str* s_dst, struct sip_msg* msg, fparam_t* param,
1817 1805
 				*s_dst = val.s;
1818 1806
 				*flags |= PARAM_STR;
1819 1807
 				if (str2int(&val.s, (unsigned int*)i_dst) < 0) {
1820
-					ERR("Could not convert AVP string value to int\n");
1808
+					LM_ERR("Could not convert AVP string value to int\n");
1821 1809
 					return -1;
1822 1810
 				}
1823 1811
 			} else {
... ...
@@ -1829,7 +1817,7 @@ int get_is_fparam(int* i_dst, str* s_dst, struct sip_msg* msg, fparam_t* param,
1829 1817
 			ret = run_select(&tmp, param->v.select, msg);
1830 1818
 			if (unlikely(ret < 0 || ret > 0)) return -1;
1831 1819
 			if (unlikely(str2int(&tmp, (unsigned int*)i_dst) < 0)) {
1832
-				ERR("Could not convert select result to int\n");
1820
+				LM_ERR("Could not convert select result to int\n");
1833 1821
 				return -1;
1834 1822
 			}
1835 1823
 			*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 1833
 					*flags |= PARAM_STR;
1846 1834
 				}
1847 1835
 			}else{
1848
-				ERR("Could not get PV\n");
1836
+				LM_ERR("Could not get PV\n");
1849 1837
 				return -1;
1850 1838
 			}
1851 1839
 			break;
... ...
@@ -1853,7 +1841,7 @@ int get_is_fparam(int* i_dst, str* s_dst, struct sip_msg* msg, fparam_t* param,
1853 1841
 			s_dst->s=pv_get_buffer();
1854 1842
 			s_dst->len=pv_get_buffer_size();
1855 1843
 			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");
1844
+				LM_ERR("Could not convert the PV-formated string to str\n");
1857 1845
 				s_dst->len=0;
1858 1846
 				return -1;
1859 1847
 			}
... ...
@@ -1881,7 +1869,7 @@ int get_regex_fparam(regex_t *dst, struct sip_msg* msg, fparam_t* param)
1881 1869
 			*dst = *param->v.regex;
1882 1870
 			return 0;
1883 1871
 		default:
1884
-			ERR("unexpected parameter type (%d), instead of regexp.\n", 
1872
+			LM_ERR("unexpected parameter type (%d), instead of regexp.\n", 
1885 1873
 					param->type);
1886 1874
 	}
1887 1875
 	return -1;