Browse code

dns_cache.c: logging: convert LOG to LM_*

Ovidiu Sas authored on 04/10/2014 00:14:38
Showing 1 changed files
... ...
@@ -297,13 +297,13 @@ void fix_dns_flags(str *gname, str *name)
297 297
 #ifdef DNS_SRV_LB
298 298
 		dns_flags|=DNS_SRV_RR_LB;
299 299
 #else
300
-		LOG(L_WARN, "WARNING: fix_dns_flags: SRV loadbalaning is set, but"
300
+		LM_WARN("SRV loadbalaning is set, but"
301 301
 					" support for it is not compiled -- ignoring\n");
302 302
 #endif
303 303
 	}
304 304
 	if (cfg_get(core, core_cfg, dns_try_naptr)) {
305 305
 #ifndef USE_NAPTR
306
-	LOG(L_WARN, "WARNING: fix_dns_flags: NAPTR support is enabled, but"
306
+	LM_WARN("NAPTR support is enabled, but"
307 307
 				" support for it is not compiled -- ignoring\n");
308 308
 #endif
309 309
 		dns_flags|=DNS_TRY_NAPTR;
... ...
@@ -316,8 +316,7 @@ void fix_dns_flags(str *gname, str *name)
316 316
 int use_dns_failover_fixup(void *handle, str *gname, str *name, void **val)
317 317
 {
318 318
 	if ((int)(long)(*val) && !cfg_get(core, handle, use_dns_cache)) {
319
-		LOG(L_ERR, "ERROR: use_dns_failover_fixup(): "
320
-			"DNS cache is turned off, failover cannot be enabled. "
319
+		LM_ERR("DNS cache is turned off, failover cannot be enabled. "
321 320
 			"(set use_dns_cache to 1)\n");
322 321
 		return -1;
323 322
 	}
... ...
@@ -330,14 +329,12 @@ int use_dns_failover_fixup(void *handle, str *gname, str *name, void **val)
330 329
 int use_dns_cache_fixup(void *handle, str *gname, str *name, void **val)
331 330
 {
332 331
 	if ((int)(long)(*val) && !dns_cache_init) {
333
-		LOG(L_ERR, "ERROR: use_dns_cache_fixup(): "
334
-			"DNS cache is turned off by dns_cache_init=0, "
332
+		LM_ERR("DNS cache is turned off by dns_cache_init=0, "
335 333
 			"it cannot be enabled runtime.\n");
336 334
 		return -1;
337 335
 	}
338 336
 	if (((int)(long)(*val)==0) && cfg_get(core, handle, use_dns_failover)) {
339
-		LOG(L_ERR, "ERROR: use_dns_failover_fixup(): "
340
-			"DNS failover depends on use_dns_cache, set use_dns_failover "
337
+		LM_ERR("DNS failover depends on use_dns_cache, set use_dns_failover "
341 338
 			"to 0 before disabling the DNS cache\n");
342 339
 		return -1;
343 340
 	}
... ...
@@ -369,7 +366,7 @@ int init_dns_cache()
369 366
 	ret=0;
370 367
 	/* sanity check */
371 368
 	if (E_DNS_CRITICAL>=sizeof(dns_str_errors)/sizeof(char*)){
372
-		LOG(L_CRIT, "BUG: dns_cache_init: bad dns error table\n");
369
+		LM_CRIT("bad dns error table\n");
373 370
 		ret=E_BUG;
374 371
 		goto error;
375 372
 	}
... ...
@@ -430,7 +427,7 @@ int init_dns_cache()
430 427
 	if (dns_timer_interval){
431 428
 		timer_init(dns_timer_h, dns_timer, 0, 0); /* "slow" timer */
432 429
 		if (timer_add(dns_timer_h, S_TO_TICKS(dns_timer_interval))<0){
433
-			LOG(L_CRIT, "BUG: dns_cache_init: failed to add the timer\n");
430
+			LM_CRIT("failed to add the timer\n");
434 431
 			timer_free(dns_timer_h);
435 432
 			dns_timer_h=0;
436 433
 			goto error;
... ...
@@ -481,7 +478,7 @@ int init_dns_cache_stats(int iproc_num)
481 478
 							((l)!=dns_last_used_lst))
482 479
 
483 480
 #define dbg_lu_lst(txt, l) \
484
-		LOG(L_CRIT, "BUG: %s: crt(%p, %p, %p)," \
481
+		LM_CRIT("%s: crt(%p, %p, %p)," \
485 482
 					" prev(%p, %p, %p), next(%p, %p, %p)\n", txt, \
486 483
 					(l), (l)->next, (l)->prev, \
487 484
 					(l)->prev, (l)->prev->next, (l)->prev->prev, \
... ...
@@ -617,8 +614,8 @@ again:
617 614
 					  return the last cname */
618 615
 			/* this is a cname => retry using its value */
619 616
 			if (cname_chain> MAX_CNAME_CHAIN){
620
-				LOG(L_ERR, "ERROR: _dns_hash_find: cname chain too long "
621
-						"or recursive (\"%.*s\")\n", name->len, name->s);
617
+				LM_ERR("cname chain too long or recursive (\"%.*s\")\n",
618
+						name->len, name->s);
622 619
 				ret=0; /* error*/
623 620
 				*err=-1;
624 621
 				break;
... ...
@@ -814,12 +811,12 @@ inline static int dns_cache_add(struct dns_hash_entry* e)
814 811
 #ifdef USE_DNS_CACHE_STATS
815 812
 		dns_cache_stats[process_no].dc_lru_cnt++;
816 813
 #endif
817
-		LOG(L_WARN, "WARNING: dns_cache_add: cache full, trying to free...\n");
814
+		LM_WARN("cache full, trying to free...\n");
818 815
 		/* free ~ 12% of the cache */
819 816
 		dns_cache_free_mem(*dns_cache_mem_used/16*14,
820 817
 					!cfg_get(core, core_cfg, dns_cache_del_nonexp));
821 818
 		if ((*dns_cache_mem_used+e->total_size)>=cfg_get(core, core_cfg, dns_cache_max_mem)){
822
-			LOG(L_ERR, "ERROR: dns_cache_add: max. cache mem size exceeded\n");
819
+			LM_ERR("max. cache mem size exceeded\n");
823 820
 			return -1;
824 821
 		}
825 822
 	}
... ...
@@ -854,14 +851,14 @@ inline static int dns_cache_add_unsafe(struct dns_hash_entry* e)
854 851
 #ifdef USE_DNS_CACHE_STATS
855 852
 		dns_cache_stats[process_no].dc_lru_cnt++;
856 853
 #endif
857
-		LOG(L_WARN, "WARNING: dns_cache_add: cache full, trying to free...\n");
854
+		LM_WARN("cache full, trying to free...\n");
858 855
 		/* free ~ 12% of the cache */
859 856
 		UNLOCK_DNS_HASH();
860 857
 		dns_cache_free_mem(*dns_cache_mem_used/16*14,
861 858
 					!cfg_get(core, core_cfg, dns_cache_del_nonexp));
862 859
 		LOCK_DNS_HASH();
863 860
 		if ((*dns_cache_mem_used+e->total_size)>=cfg_get(core, core_cfg, dns_cache_max_mem)){
864
-			LOG(L_ERR, "ERROR: dns_cache_add: max. cache mem size exceeded\n");
861
+			LM_ERR("max. cache mem size exceeded\n");
865 862
 			return -1;
866 863
 		}
867 864
 	}
... ...
@@ -899,7 +896,7 @@ inline static struct dns_hash_entry* dns_cache_mk_bad_entry(str* name,
899 896
 	size=sizeof(struct dns_hash_entry)+name->len-1+1;
900 897
 	e=shm_malloc(size);
901 898
 	if (e==0){
902
-		LOG(L_ERR, "ERROR: dns_cache_mk_bad_entry: out of memory\n");
899
+		LM_ERR("out of memory\n");
903 900
 		return 0;
904 901
 	}
905 902
 	memset(e, 0, size); /* init with 0*/
... ...
@@ -940,7 +937,7 @@ inline static struct dns_hash_entry* dns_cache_mk_ip_entry(str* name,
940 937
 			sizeof(struct dns_rr)+ ip->len;
941 938
 	e=shm_malloc(size);
942 939
 	if (e==0){
943
-		LOG(L_ERR, "ERROR: dns_cache_mk_ip_entry: out of memory\n");
940
+		LM_ERR("out of memory\n");
944 941
 		return 0;
945 942
 	}
946 943
 	memset(e, 0, size); /* init with 0*/
... ...
@@ -993,7 +990,7 @@ static struct dns_hash_entry* dns_cache_mk_srv_entry(str* name,
993 990
 
994 991
 	e=shm_malloc(size);
995 992
 	if (e==0){
996
-		LOG(L_ERR, "ERROR: dns_cache_srv_ip_entry: out of memory\n");
993
+		LM_ERR("out of memory\n");
997 994
 		return 0;
998 995
 	}
999 996
 	memset(e, 0, size); /* init with 0*/
... ...
@@ -1232,8 +1229,7 @@ inline static struct dns_hash_entry* dns_cache_mk_rd_entry(str* name, int type,
1232 1229
 			}
1233 1230
 			break;
1234 1231
 		default:
1235
-			LOG(L_CRIT, "BUG: dns_cache_mk_rd_entry: type %d not "
1236
-							"supported\n", type);
1232
+			LM_CRIT("type %d not supported\n", type);
1237 1233
 			/* we don't know what to do with it, so don't
1238 1234
 			 * add it to the tmp_lst */
1239 1235
 			return 0; /* error */
... ...
@@ -1250,7 +1246,7 @@ inline static struct dns_hash_entry* dns_cache_mk_rd_entry(str* name, int type,
1250 1246
 	size+=ROUND_POINTER(sizeof(struct dns_hash_entry)+name->len-1+1);
1251 1247
 	e=shm_malloc(size);
1252 1248
 	if (e==0){
1253
-		LOG(L_ERR, "ERROR: dns_cache_mk_rd_entry: out of memory\n");
1249
+		LM_ERR("out of memory\n");
1254 1250
 		return 0;
1255 1251
 	}
1256 1252
 	memset(e, 0, size); /* init with 0 */
... ...
@@ -1421,8 +1417,7 @@ inline static struct dns_hash_entry* dns_cache_mk_rd_entry(str* name, int type,
1421 1417
 			break;
1422 1418
 		default:
1423 1419
 			/* do nothing */
1424
-			LOG(L_CRIT, "BUG: dns_cache_mk_rd_entry: create: type %d not "
1425
-							"supported\n", type);
1420
+			LM_CRIT("type %d not supported\n", type);
1426 1421
 				;
1427 1422
 	}
1428 1423
 	*tail_rr=0; /* terminate the list */
... ...
@@ -1498,8 +1493,7 @@ inline static struct dns_hash_entry* dns_cache_mk_rd_entry2(struct rdata* rd)
1498 1493
 							rec[r].rd->name_len-1+1);
1499 1494
 			no_records++;
1500 1495
 		}else{
1501
-			LOG(L_ERR, "ERROR: dns_cache_mk_rd_entry2: too many records: %d\n",
1502
-						no_records);
1496
+			LM_ERR("too many records: %d\n", no_records);
1503 1497
 			/* skip */
1504 1498
 			continue;
1505 1499
 		}
... ...
@@ -1550,8 +1544,7 @@ found:
1550 1544
 							PTR_RDATA_SIZE(*(struct ptr_rdata*)l->rdata));
1551 1545
 				break;
1552 1546
 			default:
1553
-				LOG(L_CRIT, "BUG: dns_cache_mk_rd_entry: type %d not "
1554
-							"supported\n", l->type);
1547
+				LM_CRIT("type %d not supported\n", l->type);
1555 1548
 		}
1556 1549
 	}
1557 1550
 
... ...
@@ -1560,7 +1553,7 @@ found:
1560 1553
 	for (r=0; r<no_records; r++){
1561 1554
 		rec[r].e=shm_malloc(rec[r].size);
1562 1555
 		if (rec[r].e==0){
1563
-			LOG(L_ERR, "ERROR: dns_cache_mk_rd_entry: out of memory\n");
1556
+			LM_ERR("out of memory\n");
1564 1557
 			goto error;
1565 1558
 		}
1566 1559
 		memset(rec[r].e, 0, rec[r].size); /* init with 0*/
... ...
@@ -1915,8 +1908,7 @@ inline static struct dns_hash_entry* dns_cache_do_request(str* name, int type)
1915 1908
 		goto end; /* the servers are down, needless to perform the query */
1916 1909
 #endif
1917 1910
 	if (name->len>=MAX_DNS_NAME){
1918
-		LOG(L_ERR, "ERROR: dns_cache_do_request: name too long (%d chars)\n",
1919
-					name->len);
1911
+		LM_ERR("name too long (%d chars)\n", name->len);
1920 1912
 		goto end;
1921 1913
 	}
1922 1914
 	/* null terminate the string, needed by get_record */
... ...
@@ -2133,8 +2125,8 @@ inline static struct dns_hash_entry* dns_get_entry(str* name, int type)
2133 2125
 
2134 2126
 	e=0;
2135 2127
 	if (rec_cnt>MAX_CNAME_CHAIN){
2136
-		LOG(L_WARN, "WARNING: dns_get_entry: CNAME chain too long or"
2137
-				" recursive CNAMEs (\"%.*s\")\n", name->len, name->s);
2128
+		LM_WARN("CNAME chain too long or recursive CNAMEs (\"%.*s\")\n",
2129
+				name->len, name->s);
2138 2130
 		goto error;
2139 2131
 	}
2140 2132
 	rec_cnt++;
... ...
@@ -2414,7 +2406,7 @@ inline static struct hostent* dns_entry2he(struct dns_hash_entry* e)
2414 2406
 			len=16;
2415 2407
 			break;
2416 2408
 		default:
2417
-			LOG(L_CRIT, "BUG: dns_entry2he: wrong entry type %d for %.*s\n",
2409
+			LM_CRIT("wrong entry type %d for %.*s\n",
2418 2410
 					e->type, e->name_len, e->name);
2419 2411
 			return 0;
2420 2412
 	}
... ...
@@ -2676,8 +2668,8 @@ struct hostent* dns_srv_sip_resolvehost(str* name, unsigned short* port,
2676 2668
 		*port=(srv_proto==PROTO_TLS)?SIPS_PORT:SIP_PORT; /* just in case we
2677 2669
 														 don't find another */
2678 2670
 		if ((name->len+SRV_MAX_PREFIX_LEN+1)>MAX_DNS_NAME){
2679
-			LOG(L_WARN, "WARNING: dns_sip_resolvehost: domain name too long"
2680
-						" (%d), unable to perform SRV lookup\n", name->len);
2671
+			LM_WARN("domain name too long (%d), unable to perform SRV lookup\n",
2672
+						name->len);
2681 2673
 		}else{
2682 2674
 			/* check if it's an ip address */
2683 2675
 			if ( ((ip=str2ip(name))!=0)
... ...
@@ -2700,8 +2692,7 @@ struct hostent* dns_srv_sip_resolvehost(str* name, unsigned short* port,
2700 2692
 					create_srv_name(srv_proto, name, tmp);
2701 2693
 					break;
2702 2694
 				default:
2703
-					LOG(L_CRIT, "BUG: sip_resolvehost: unknown proto %d\n",
2704
-							(int)srv_proto);
2695
+					LM_CRIT("unknown proto %d\n", (int)srv_proto);
2705 2696
 					return 0;
2706 2697
 			}
2707 2698
 
... ...
@@ -2713,7 +2704,7 @@ struct hostent* dns_srv_sip_resolvehost(str* name, unsigned short* port,
2713 2704
 	}
2714 2705
 /*skip_srv:*/
2715 2706
 	if (name->len >= MAX_DNS_NAME) {
2716
-		LOG(L_ERR, "dns_sip_resolvehost: domain name too long\n");
2707
+		LM_ERR("domain name too long\n");
2717 2708
 		return 0;
2718 2709
 	}
2719 2710
 	he=dns_get_he(name, dns_flags);
... ...
@@ -2758,7 +2749,7 @@ struct naptr_rdata* dns_naptr_sip_iterate(struct dns_rr* naptr_head,
2758 2749
 	for(l=naptr_head; l && (i<MAX_NAPTR_RRS); l=l->next){
2759 2750
 		naptr=(struct naptr_rdata*) l->rdata;
2760 2751
 		if (naptr==0){
2761
-				LOG(L_CRIT, "naptr_iterate: BUG: null rdata\n");
2752
+			LM_CRIT("null rdata\n");
2762 2753
 			goto end;
2763 2754
 		}
2764 2755
 		/* check if valid and get proto */
... ...
@@ -2820,8 +2811,7 @@ struct hostent* dns_naptr_sip_resolvehost(str* name, unsigned short* port,
2820 2811
 	origproto=*proto;
2821 2812
 	he=0;
2822 2813
 	if (dns_hash==0){ /* not init => use normal, non-cached version */
2823
-		LOG(L_WARN, "WARNING: dns_sip_resolvehost: called before dns cache"
2824
-					" initialization\n");
2814
+		LM_WARN("called before dns cache initialization\n");
2825 2815
 		return _sip_resolvehost(name, port, proto);
2826 2816
 	}
2827 2817
 	if (proto && port && (*proto==0) && (*port==0)){
... ...
@@ -3085,8 +3075,7 @@ inline static int dns_ip_resolve(	struct dns_hash_entry** e,
3085 3075
 			dns_hash_put(orig);
3086 3076
 		}
3087 3077
 	}else{
3088
-		LOG(L_CRIT, "BUG: dns_ip_resolve: invalid record type %d\n",
3089
-					(*e)->type);
3078
+		LM_CRIT("invalid record type %d\n", (*e)->type);
3090 3079
 	}
3091 3080
 	return ret;
3092 3081
 }
... ...
@@ -3232,8 +3221,7 @@ inline static int dns_srv_sip_resolve(struct dns_srv_handle* h,  str* name,
3232 3221
 
3233 3222
 	origproto = *proto;
3234 3223
 	if (dns_hash==0){ /* not init => use normal, non-cached version */
3235
-		LOG(L_WARN, "WARNING: dns_srv_sip_resolve: called before dns cache"
3236
-					" initialization\n");
3224
+		LM_WARN("called before dns cache initialization\n");
3237 3225
 		h->srv=h->a=0;
3238 3226
 		he=_sip_resolvehost(name, port, proto);
3239 3227
 		if (he){
... ...
@@ -3254,8 +3242,7 @@ inline static int dns_srv_sip_resolve(struct dns_srv_handle* h,  str* name,
3254 3242
 				/* try SRV if initial call & no port specified
3255 3243
 				 * (draft-ietf-sip-srv-06) */
3256 3244
 				if ((name->len+SRV_MAX_PREFIX_LEN+1)>MAX_DNS_NAME){
3257
-					LOG(L_WARN, "WARNING: dns_srv_sip_resolve: domain name too"
3258
-								" long (%d), unable to perform SRV lookup\n",
3245
+					LM_WARN("domain name too long (%d), unable to perform SRV lookup\n",
3259 3246
 								name->len);
3260 3247
 				}else{
3261 3248
 					/* check if it's an ip address */
... ...
@@ -3284,8 +3271,7 @@ inline static int dns_srv_sip_resolve(struct dns_srv_handle* h,  str* name,
3284 3271
 								create_srv_name(srv_proto_list[i].proto, name, tmp);
3285 3272
 								break;
3286 3273
 							default:
3287
-								LOG(L_CRIT, "BUG: dns_srv_sip_resolve: "
3288
-										"unknown proto %d\n", (int)srv_proto_list[i].proto);
3274
+								LM_CRIT("unknown proto %d\n", (int)srv_proto_list[i].proto);
3289 3275
 								return -E_DNS_CRITICAL;
3290 3276
 						}
3291 3277
 						srv_name.s=tmp;
... ...
@@ -3318,7 +3304,7 @@ inline static int dns_srv_sip_resolve(struct dns_srv_handle* h,  str* name,
3318 3304
 			return ret;
3319 3305
 	}
3320 3306
 	if (name->len >= MAX_DNS_NAME) {
3321
-		LOG(L_ERR, "dns_srv_sip_resolve: domain name too long\n");
3307
+		LM_ERR("domain name too long\n");
3322 3308
 		return -E_DNS_NAME_TOO_LONG;
3323 3309
 	}
3324 3310
 	ret=dns_ip_resolve(&h->a, &h->ip_no, name, ip, flags);
... ...
@@ -3364,8 +3350,7 @@ inline static int dns_naptr_sip_resolve(struct dns_srv_handle* h,  str* name,
3364 3350
 	ret=-E_DNS_NO_NAPTR;
3365 3351
 	origproto=*proto;
3366 3352
 	if (dns_hash==0){ /* not init => use normal, non-cached version */
3367
-		LOG(L_WARN, "WARNING: dns_sip_resolve: called before dns cache"
3368
-					" initialization\n");
3353
+		LM_WARN("called before dns cache initialization\n");
3369 3354
 		h->srv=h->a=0;
3370 3355
 		he=_sip_resolvehost(name, port, proto);
3371 3356
 		if (he){
... ...
@@ -4027,8 +4012,7 @@ static struct dns_hash_entry *dns_cache_clone_entry(struct dns_hash_entry *e,
4027 4012
 				rr_size = sizeof(struct dns_rr);
4028 4013
 				break;
4029 4014
 			default:
4030
-				LOG(L_ERR, "ERROR: dns_cache_clone_entry: type %d not "
4031
-							"supported\n", e->type);
4015
+				LM_ERR("type %d not supported\n", e->type);
4032 4016
 				return NULL;
4033 4017
 		}
4034 4018
 	} else {
... ...
@@ -4039,7 +4023,7 @@ static struct dns_hash_entry *dns_cache_clone_entry(struct dns_hash_entry *e,
4039 4023
 
4040 4024
 	new=shm_malloc(rounded_size+rr_size+rdata_size);
4041 4025
 	if (!new) {
4042
-		LOG(L_ERR, "ERROR: dns_cache_clone_entry: out of memory\n");
4026
+		LM_ERR("out of memory\n");
4043 4027
 		return NULL;
4044 4028
 	}
4045 4029
 	memset(new, 0, rounded_size+rr_size+rdata_size);
... ...
@@ -4167,13 +4151,12 @@ int dns_cache_add_record(unsigned short type,
4167 4151
 	rr_name.len = 0;
4168 4152
 
4169 4153
 	if (!cfg_get(core, core_cfg, use_dns_cache)){
4170
-		LOG(L_ERR, "ERROR: dns cache support disabled (see use_dns_cache)\n");
4154
+		LM_ERR("dns cache support disabled (see use_dns_cache)\n");
4171 4155
 		return -1;
4172 4156
 	}
4173 4157
 	
4174 4158
 	if ((type != T_A) && (type != T_AAAA) && (type != T_SRV)) {
4175
-		LOG(L_ERR, "ERROR: rr type %d is not implemented\n",
4176
-			type);
4159
+		LM_ERR("rr type %d is not implemented\n", type);
4177 4160
 		return -1;
4178 4161
 	}
4179 4162
 
... ...
@@ -4183,7 +4166,7 @@ int dns_cache_add_record(unsigned short type,
4183 4166
 		case T_A:
4184 4167
 			ip_addr = str2ip(value);
4185 4168
 			if (!ip_addr) {
4186
-				LOG(L_ERR, "ERROR: Malformed ip address: %.*s\n",
4169
+				LM_ERR("Malformed ip address: %.*s\n",
4187 4170
 					value->len, value->s);
4188 4171
 				return -1;
4189 4172
 			}
... ...
@@ -4191,7 +4174,7 @@ int dns_cache_add_record(unsigned short type,
4191 4174
 		case T_AAAA:
4192 4175
 			ip_addr = str2ip6(value);
4193 4176
 			if (!ip_addr) {
4194
-				LOG(L_ERR, "ERROR: Malformed ip address: %.*s\n",
4177
+				LM_ERR("Malformed ip address: %.*s\n",
4195 4178
 					value->len, value->s);
4196 4179
 				return -1;
4197 4180
 			}
... ...
@@ -4215,7 +4198,7 @@ int dns_cache_add_record(unsigned short type,
4215 4198
 		&& (old->ent_flags & DNS_FLAG_PERMANENT)
4216 4199
 		&& ((flags & DNS_FLAG_PERMANENT) == 0)
4217 4200
 	) {
4218
-		LOG(L_ERR, "ERROR: A non-permanent record cannot overwrite "
4201
+		LM_ERR("A non-permanent record cannot overwrite "
4219 4202
 				"a permanent entry\n");
4220 4203
 		goto error;
4221 4204
 	}
... ...
@@ -4224,7 +4207,7 @@ int dns_cache_add_record(unsigned short type,
4224 4207
 		/* negative entry */
4225 4208
 		new = dns_cache_mk_bad_entry(name, type, ttl, flags);
4226 4209
 		if (!new) {
4227
-			LOG(L_ERR, "ERROR: Failed to create a negative "
4210
+			LM_ERR("Failed to create a negative "
4228 4211
 					"DNS cache entry\n");
4229 4212
 			goto error;
4230 4213
 		}
... ...
@@ -4244,7 +4227,7 @@ int dns_cache_add_record(unsigned short type,
4244 4227
 			case T_AAAA:
4245 4228
 				new = dns_cache_mk_ip_entry(name, ip_addr);
4246 4229
 				if (!new) {
4247
-					LOG(L_ERR, "ERROR: Failed to create an A/AAAA record\n");
4230
+					LM_ERR("Failed to create an A/AAAA record\n");
4248 4231
 					goto error;
4249 4232
 				}
4250 4233
 				/* fix the expiration time, dns_cache_mk_ip_entry() sets it 
... ...
@@ -4257,7 +4240,7 @@ int dns_cache_add_record(unsigned short type,
4257 4240
 				new = dns_cache_mk_srv_entry(name, priority, weight, port,
4258 4241
 												&rr_name, ttl);
4259 4242
 				if (!new) {
4260
-					LOG(L_ERR, "ERROR: Failed to create an SRV record\n");
4243
+					LM_ERR("Failed to create an SRV record\n");
4261 4244
 					goto error;
4262 4245
 				}
4263 4246
 			}
... ...
@@ -4284,7 +4267,7 @@ int dns_cache_add_record(unsigned short type,
4284 4267
 				/* the rr was found in the list */
4285 4268
 				new = dns_cache_clone_entry(old, 0, 0, 0);
4286 4269
 				if (!new) {
4287
-					LOG(L_ERR, "ERROR: Failed to clone an existing "
4270
+					LM_ERR("Failed to clone an existing "
4288 4271
 							"DNS cache entry\n");
4289 4272
 					goto error;
4290 4273
 				}
... ...
@@ -4322,7 +4305,7 @@ int dns_cache_add_record(unsigned short type,
4322 4305
 				}
4323 4306
 				new = dns_cache_clone_entry(old, size, ttl, &rr);
4324 4307
 				if (!new) {
4325
-					LOG(L_ERR, "ERROR: Failed to clone an existing "
4308
+					LM_ERR("Failed to clone an existing "
4326 4309
 							"DNS cache entry\n");
4327 4310
 					goto error;
4328 4311
 				}
... ...
@@ -4372,7 +4355,7 @@ int dns_cache_add_record(unsigned short type,
4372 4355
 						rr_p = &((*rr_p)->next)
4373 4356
 					);
4374 4357
 				if (!rr_p) {
4375
-					LOG(L_ERR, "ERROR: Failed to correct the orderd list of SRV resource records\n");
4358
+					LM_ERR("Failed to correct the orderd list of SRV resource records\n");
4376 4359
 					goto error;
4377 4360
 				}
4378 4361
 
... ...
@@ -4389,7 +4372,7 @@ int dns_cache_add_record(unsigned short type,
4389 4372
 
4390 4373
 	LOCK_DNS_HASH();
4391 4374
 	if (dns_cache_add_unsafe(new)) {
4392
-		LOG(L_ERR, "ERROR: Failed to add the entry to the cache\n");
4375
+		LM_ERR("Failed to add the entry to the cache\n");
4393 4376
 		UNLOCK_DNS_HASH();
4394 4377
 		goto error;
4395 4378
 	} else {
... ...
@@ -4470,13 +4453,12 @@ int dns_cache_delete_single_record(unsigned short type,
4470 4453
 	ip_addr = 0;
4471 4454
 
4472 4455
 	if (!cfg_get(core, core_cfg, use_dns_cache)){
4473
-		LOG(L_ERR, "ERROR: dns cache support disabled (see use_dns_cache)\n");
4456
+		LM_ERR("dns cache support disabled (see use_dns_cache)\n");
4474 4457
 		return -1;
4475 4458
 	}
4476 4459
 	
4477 4460
 	if ((type != T_A) && (type != T_AAAA) && (type != T_SRV)) {
4478
-		LOG(L_ERR, "ERROR: rr type %d is not implemented\n",
4479
-			type);
4461
+		LM_ERR("rr type %d is not implemented\n", type);
4480 4462
 		return -1;
4481 4463
 	}
4482 4464
 
... ...
@@ -4486,7 +4468,7 @@ int dns_cache_delete_single_record(unsigned short type,
4486 4468
 		case T_A:
4487 4469
 			ip_addr = str2ip(value);
4488 4470
 			if (!ip_addr) {
4489
-				LOG(L_ERR, "ERROR: Malformed ip address: %.*s\n",
4471
+				LM_ERR("Malformed ip address: %.*s\n",
4490 4472
 					value->len, value->s);
4491 4473
 				return -1;
4492 4474
 			}
... ...
@@ -4494,7 +4476,7 @@ int dns_cache_delete_single_record(unsigned short type,
4494 4476
 		case T_AAAA:
4495 4477
 			ip_addr = str2ip6(value);
4496 4478
 			if (!ip_addr) {
4497
-				LOG(L_ERR, "ERROR: Malformed ip address: %.*s\n",
4479
+				LM_ERR("Malformed ip address: %.*s\n",
4498 4480
 					value->len, value->s);
4499 4481
 				return -1;
4500 4482
 			}
... ...
@@ -4546,8 +4528,7 @@ int dns_cache_delete_single_record(unsigned short type,
4546 4528
 		* automatically destroyed when its refcnt will be 0*/
4547 4529
 		new = dns_cache_clone_entry(old, 0, 0, 0);
4548 4530
 		if (!new) {
4549
-			LOG(L_ERR, "ERROR: Failed to clone an existing "
4550
-				"DNS cache entry\n");
4531
+			LM_ERR("Failed to clone an existing DNS cache entry\n");
4551 4532
 			dns_hash_put(old);
4552 4533
 			return -1;
4553 4534
 		}
... ...
@@ -4568,7 +4549,7 @@ delete:
4568 4549
 	if (new) {
4569 4550
 		/* delete the old entry only if the new one can be added */
4570 4551
 		if (dns_cache_add_unsafe(new)) {
4571
-			LOG(L_ERR, "ERROR: Failed to add the entry to the cache\n");
4552
+			LM_ERR("Failed to add the entry to the cache\n");
4572 4553
 			UNLOCK_DNS_HASH();
4573 4554
 			if (old)
4574 4555
 				dns_hash_put(old);
... ...
@@ -4588,7 +4569,7 @@ delete:
4588 4569
 	return 0;
4589 4570
 
4590 4571
 not_found:
4591
-	LOG(L_ERR, "ERROR: No matching record found\n");
4572
+	LM_ERR("No matching record found\n");
4592 4573
 	if (old)
4593 4574
 		dns_hash_put(old);
4594 4575
 	return -1;