Browse code

ut.h: logging: convert LOG to LM_*

Ovidiu Sas authored on 03/10/2014 18:28:48
Showing 1 changed files
... ...
@@ -316,7 +316,7 @@ static inline char* int2strbuf(unsigned long l, char *r, int r_size, int* len)
316 316
 		l/=10;
317 317
 	}while(l && (i>=0));
318 318
 	if (l && (i<0)){
319
-		LOG(L_CRIT, "BUG: int2str: overflow\n");
319
+		LM_CRIT("overflow\n");
320 320
 	}
321 321
 	if (len) *len=(INT2STR_MAX_LEN-2)-i;
322 322
 	return &r[i+1];
... ...
@@ -558,7 +558,7 @@ inline static int hex2int(char hex_digit)
558 558
 	if (hex_digit>='A' && hex_digit<='F')
559 559
 		return hex_digit-'A'+10;
560 560
 	/* no valid hex digit ... */
561
-	LOG(L_ERR, "ERROR: hex2int: '%c' is no hex char\n", hex_digit );
561
+	LM_ERR("'%c' is no hex char\n", hex_digit );
562 562
 	return -1;
563 563
 }
564 564
 
... ...
@@ -581,7 +581,7 @@ inline static int un_escape(str *user, str *new_user )
581 581
 	int hi, lo;
582 582
 
583 583
 	if( new_user==0 || new_user->s==0) {
584
-		LOG(L_CRIT, "BUG: un_escape: called with invalid param\n");
584
+		LM_CRIT("invalid param\n");
585 585
 		return -1;
586 586
 	}
587 587
 
... ...
@@ -591,28 +591,27 @@ inline static int un_escape(str *user, str *new_user )
591 591
 	for (i = 0; i < user->len; i++) {
592 592
 		if (user->s[i] == '%') {
593 593
 			if (i + 2 >= user->len) {
594
-				LOG(L_ERR, "ERROR: un_escape: escape sequence too short in"
595
-					" '%.*s' @ %d\n",
594
+				LM_ERR("escape sequence too short in '%.*s' @ %d\n",
596 595
 					user->len, user->s, i );
597 596
 				goto error;
598 597
 			}
599 598
 			hi=hex2int(user->s[i + 1]);
600 599
 			if (hi<0) {
601
-				LOG(L_ERR, "ERROR: un_escape: non-hex high digit in an escape sequence in"
600
+				LM_ERR("non-hex high digit in an escape sequence in"
602 601
 					" '%.*s' @ %d\n",
603 602
 					user->len, user->s, i+1 );
604 603
 				goto error;
605 604
 			}
606 605
 			lo=hex2int(user->s[i + 2]);
607 606
 			if (lo<0) {
608
-				LOG(L_ERR, "ERROR: non-hex low digit in an escape sequence in "
607
+				LM_ERR("non-hex low digit in an escape sequence in "
609 608
 					"'%.*s' @ %d\n",
610 609
 					user->len, user->s, i+2 );
611 610
 				goto error;
612 611
 			}
613 612
 			value=(hi<<4)+lo;
614 613
 			if (value < 32 || value > 126) {
615
-				LOG(L_ERR, "ERROR: non-ASCII escaped character in '%.*s' @ %d\n",
614
+				LM_ERR("non-ASCII escaped character in '%.*s' @ %d\n",
616 615
 					user->len, user->s, i );
617 616
 				goto error;
618 617
 			}