Browse code

Added LF character at the end of every log message

- requested in ticket FS#452

Carlos Ruiz Diaz authored on 20/07/2014 13:19:32
Showing 4 changed files
... ...
@@ -51,7 +51,7 @@ void check_calls_by_money(unsigned int ticks, void *param)
51 51
 
52 52
 				if (i > SAFE_ITERATION_THRESHOLD)
53 53
 				{
54
-					LM_ERR("Too many iterations for this loop: %d", i);
54
+					LM_ERR("Too many iterations for this loop: %d\n", i);
55 55
 					break;
56 56
 				}
57 57
 				lock_get(&credit_data->lock);
... ...
@@ -138,7 +138,7 @@ void check_calls_by_time(unsigned int ticks, void *param)
138 138
 
139 139
 				if (i > SAFE_ITERATION_THRESHOLD)
140 140
 				{
141
-					LM_ERR("Too many iterations for this loop: %d", i);
141
+					LM_ERR("Too many iterations for this loop: %d\n", i);
142 142
 					break;
143 143
 				}
144 144
 
... ...
@@ -240,17 +240,17 @@ static int mod_init(void)
240 240
 	_data.cs_route_number = route_get(&event_rt, "cnxcc:call-shutdown");
241 241
 
242 242
 	if (_data.cs_route_number < 0)
243
-		LM_INFO("No cnxcc:call-shutdown event route found");
243
+		LM_INFO("No cnxcc:call-shutdown event route found\n");
244 244
 
245 245
 	if (_data.cs_route_number > 0 && event_rt.rlist[_data.cs_route_number] == NULL)
246 246
 	{
247
-		LM_INFO("cnxcc:call-shutdown route is empty");
247
+		LM_INFO("cnxcc:call-shutdown route is empty\n");
248 248
 		_data.cs_route_number	= -1;
249 249
 	}
250 250
 
251 251
 	if (_data.check_period <= 0)
252 252
 	{
253
-		LM_INFO("credit_check_period cannot be less than 1 second");
253
+		LM_INFO("credit_check_period cannot be less than 1 second\n");
254 254
 		return -1;
255 255
 	}
256 256
 
... ...
@@ -376,7 +376,7 @@ static void dialog_created_callback(struct dlg_cell *cell, int type, struct dlg_
376 376
 		return;
377 377
 	}
378 378
 
379
-	LM_DBG("Dialog created for CID [%.*s]", cell->callid.len, cell->callid.s);
379
+	LM_DBG("Dialog created for CID [%.*s]\n", cell->callid.len, cell->callid.s);
380 380
 
381 381
 	_dlgbinds.register_dlgcb(cell, DLGCB_CONFIRMED, dialog_confirmed_callback, NULL, NULL);
382 382
 	_dlgbinds.register_dlgcb(cell, DLGCB_TERMINATED|DLGCB_FAILED|DLGCB_EXPIRED, dialog_terminated_callback, NULL, NULL);
... ...
@@ -386,14 +386,14 @@ static void dialog_created_callback(struct dlg_cell *cell, int type, struct dlg_
386 386
 
387 387
 static void dialog_confirmed_callback(struct dlg_cell *cell, int type, struct dlg_cb_params *params)
388 388
 {
389
-	LM_DBG("Dialog confirmed for CID [%.*s]", cell->callid.len, cell->callid.s);
389
+	LM_DBG("Dialog confirmed for CID [%.*s]\n", cell->callid.len, cell->callid.s);
390 390
 
391 391
 	start_billing(&cell->callid, cell->tag);
392 392
 }
393 393
 
394 394
 static void dialog_terminated_callback(struct dlg_cell *cell, int type, struct dlg_cb_params *params)
395 395
 {
396
-	LM_DBG("Dialog terminated for CID [%.*s]", cell->callid.len, cell->callid.s);
396
+	LM_DBG("Dialog terminated for CID [%.*s]\n", cell->callid.len, cell->callid.s);
397 397
 
398 398
 	stop_billing(&cell->callid);
399 399
 }
... ...
@@ -416,7 +416,7 @@ static void notify_call_termination(str *callid, str *from_tag, str *to_tag)
416 416
 	//run_top_route(event_rt.rlist[_data.cs_route_number], msg, &ra_ctx);
417 417
 
418 418
 	if (run_actions(&ra_ctx, event_rt.rlist[_data.cs_route_number], msg) < 0)
419
-		LM_ERR("Error executing cnxcc:call-shutdown route");
419
+		LM_ERR("Error executing cnxcc:call-shutdown route\n");
420 420
 }
421 421
 
422 422
 int try_get_credit_data_entry(str *client_id, credit_data_t **credit_data)
... ...
@@ -538,19 +538,19 @@ static void stop_billing(str *callid)
538 538
 	 */
539 539
 	if (try_get_call_entry(callid, &call, &hts) != 0)
540 540
 	{
541
-		LM_ERR("Call [%.*s] not found", callid->len, callid->s);
541
+		LM_ERR("Call [%.*s] not found\n", callid->len, callid->s);
542 542
 		return;
543 543
 	}
544 544
 
545 545
 	if (call == NULL)
546 546
 	{
547
-		LM_ERR("[%.*s] call pointer is null", callid->len, callid->s);
547
+		LM_ERR("[%.*s] call pointer is null\n", callid->len, callid->s);
548 548
 		return;
549 549
 	}
550 550
 
551 551
 	if (hts == NULL)
552 552
 	{
553
-		LM_ERR("[%.*s] result hashtable pointer is null", callid->len, callid->s);
553
+		LM_ERR("[%.*s] result hashtable pointer is null\n", callid->len, callid->s);
554 554
 		return;
555 555
 	}
556 556
 
... ...
@@ -571,7 +571,7 @@ static void stop_billing(str *callid)
571 571
 
572 572
 	if (credit_data == NULL)
573 573
 	{
574
-		LM_ERR("[%.*s]: credit_data pointer is null", callid->len, callid->s);
574
+		LM_ERR("[%.*s]: credit_data pointer is null\n", callid->len, callid->s);
575 575
 		lock_release(&hts->lock);
576 576
 		return;
577 577
 	}
... ...
@@ -605,12 +605,12 @@ static void stop_billing(str *callid)
605 605
 
606 606
 	if (credit_data->concurrent_calls < 0)
607 607
 	{
608
-		LM_ERR("[BUG]: number of concurrent calls dropped to negative value: %d", credit_data->concurrent_calls);
608
+		LM_ERR("[BUG]: number of concurrent calls dropped to negative value: %d\n", credit_data->concurrent_calls);
609 609
 	}
610 610
 
611 611
 	if (credit_data->number_of_calls < 0)
612 612
 	{
613
-		LM_ERR("[BUG]: number of calls dropped to negative value: %d", credit_data->number_of_calls);
613
+		LM_ERR("[BUG]: number of calls dropped to negative value: %d\n", credit_data->number_of_calls);
614 614
 	}
615 615
 
616 616
 	/*
... ...
@@ -665,7 +665,7 @@ static void setup_billing(str *callid, unsigned int h_entry, unsigned int h_id)
665 665
 	call_t *call						= NULL;
666 666
 	hash_tables_t *hts					= NULL;
667 667
 
668
-	LM_DBG("Creating dialog for [%.*s], h_id [%u], h_entry [%u]", callid->len, callid->s, h_id, h_entry);
668
+	LM_DBG("Creating dialog for [%.*s], h_id [%u], h_entry [%u]\n", callid->len, callid->s, h_id, h_entry);
669 669
 
670 670
 //	lock_get(&_data.lock);
671 671
 
... ...
@@ -674,19 +674,19 @@ static void setup_billing(str *callid, unsigned int h_entry, unsigned int h_id)
674 674
 	 */
675 675
 	if (try_get_call_entry(callid, &call, &hts) != 0)
676 676
 	{
677
-		LM_ERR("Call [%.*s] not found", callid->len, callid->s);
677
+		LM_ERR("Call [%.*s] not found\n", callid->len, callid->s);
678 678
 		return;
679 679
 	}
680 680
 
681 681
 	if (call == NULL)
682 682
 	{
683
-		LM_ERR("[%.*s] call pointer is null", callid->len, callid->s);
683
+		LM_ERR("[%.*s] call pointer is null\n", callid->len, callid->s);
684 684
 		return;
685 685
 	}
686 686
 
687 687
 	if (hts == NULL)
688 688
 	{
689
-		LM_ERR("[%.*s] result hashtable pointer is null", callid->len, callid->s);
689
+		LM_ERR("[%.*s] result hashtable pointer is null\n", callid->len, callid->s);
690 690
 		return;
691 691
 	}
692 692
 
... ...
@@ -717,7 +717,7 @@ static void start_billing(str *callid, str tags[2])
717 717
 	hash_tables_t *hts					= NULL;
718 718
 	credit_data_t *credit_data			= NULL;
719 719
 
720
-	LM_DBG("Billing started for call [%.*s]", callid->len, callid->s);
720
+	LM_DBG("Billing started for call [%.*s]\n", callid->len, callid->s);
721 721
 
722 722
 //	lock_get(&_data.lock);
723 723
 
... ...
@@ -726,19 +726,19 @@ static void start_billing(str *callid, str tags[2])
726 726
 	 */
727 727
 	if (try_get_call_entry(callid, &call, &hts) != 0)
728 728
 	{
729
-		LM_ERR("Call [%.*s] not found", callid->len, callid->s);
729
+		LM_ERR("Call [%.*s] not found\n", callid->len, callid->s);
730 730
 		return;
731 731
 	}
732 732
 
733 733
 	if (call == NULL)
734 734
 	{
735
-		LM_ERR("[%.*s] call pointer is null", callid->len, callid->s);
735
+		LM_ERR("[%.*s] call pointer is null\n", callid->len, callid->s);
736 736
 		return;
737 737
 	}
738 738
 
739 739
 	if (hts == NULL)
740 740
 	{
741
-		LM_ERR("[%.*s] result hashtable pointer is null", callid->len, callid->s);
741
+		LM_ERR("[%.*s] result hashtable pointer is null\n", callid->len, callid->s);
742 742
 		return;
743 743
 	}
744 744
 
... ...
@@ -760,7 +760,7 @@ static void start_billing(str *callid, str tags[2])
760 760
 
761 761
 	if (credit_data == NULL)
762 762
 	{
763
-		LM_ERR("[%.*s]: credit_data pointer is null", callid->len, callid->s);
763
+		LM_ERR("[%.*s]: credit_data pointer is null\n", callid->len, callid->s);
764 764
 		lock_release(&hts->lock);
765 765
 		return;
766 766
 	}
... ...
@@ -781,7 +781,7 @@ static void start_billing(str *callid, str tags[2])
781 781
 
782 782
 	if (call->max_amount > credit_data->max_amount)
783 783
 	{
784
-		LM_ALERT("Maximum-speak-time/credit changed, maybe a credit reload? %f > %f. Client [%.*s]", call->max_amount, credit_data->max_amount,
784
+		LM_ALERT("Maximum-speak-time/credit changed, maybe a credit reload? %f > %f. Client [%.*s]\n", call->max_amount, credit_data->max_amount,
785 785
 																							call->client_id.len, call->client_id.s);
786 786
 
787 787
 		credit_data->max_amount += call->max_amount - credit_data->max_amount;
... ...
@@ -864,7 +864,7 @@ static void free_call(call_t *call)
864 864
 
865 865
 			if (e == NULL)
866 866
 			{
867
-				LM_ERR("Call [%.*s] not found. Couldn't be able to free it from hashtable", call->sip_data.callid.len, call->sip_data.callid.s);
867
+				LM_ERR("Call [%.*s] not found. Couldn't be able to free it from hashtable\n", call->sip_data.callid.len, call->sip_data.callid.s);
868 868
 				return;
869 869
 			}
870 870
 		}
... ...
@@ -925,7 +925,7 @@ static credit_data_t *get_or_create_credit_data_entry(str *client_id, credit_typ
925 925
 		lock	=  &_data.channel.lock;
926 926
 		break;
927 927
 	default:
928
-		LM_ERR("Something went terribly wrong");
928
+		LM_ERR("Something went terribly wrong\n");
929 929
 		return NULL;
930 930
 	}
931 931
 
... ...
@@ -1309,8 +1309,8 @@ static int add_call_by_cid(str *cid, call_t *call, credit_type_t type)
1309 1309
 			return -1;
1310 1310
 		}
1311 1311
 
1312
-		LM_WARN("value cid: len=%d | value [%.*s]", value->sip_data.callid.len, value->sip_data.callid.len, value->sip_data.callid.s);
1313
-		LM_WARN("added cid: len=%d | value [%.*s]", cid->len, cid->len, cid->s);
1312
+		LM_WARN("value cid: len=%d | value [%.*s]\n", value->sip_data.callid.len, value->sip_data.callid.len, value->sip_data.callid.s);
1313
+		LM_WARN("added cid: len=%d | value [%.*s]\n", cid->len, cid->len, cid->s);
1314 1314
 
1315 1315
 		if (value->sip_data.callid.len != cid->len ||
1316 1316
 			strncasecmp(value->sip_data.callid.s, cid->s, cid->len) != 0)
... ...
@@ -1432,7 +1432,7 @@ static int set_max_credit(struct sip_msg* msg,
1432 1432
 
1433 1433
 		if (cost_per_second <= 0)
1434 1434
 		{
1435
-			LM_ERR("cost_per_second value must be > 0: %f", cost_per_second);
1435
+			LM_ERR("cost_per_second value must be > 0: %f\n", cost_per_second);
1436 1436
 			return -1;
1437 1437
 		}
1438 1438
 
... ...
@@ -1444,7 +1444,7 @@ static int set_max_credit(struct sip_msg* msg,
1444 1444
 
1445 1445
 		if (str2int(&initial_pulse_val.rs, &initial_pulse) != 0)
1446 1446
 		{
1447
-			LM_ERR("initial_pulse value is invalid: %.*s", initial_pulse_val.rs.len, initial_pulse_val.rs.s);
1447
+			LM_ERR("initial_pulse value is invalid: %.*s\n", initial_pulse_val.rs.len, initial_pulse_val.rs.s);
1448 1448
 			return -1;
1449 1449
 		}
1450 1450
 
... ...
@@ -1456,12 +1456,12 @@ static int set_max_credit(struct sip_msg* msg,
1456 1456
 
1457 1457
 		if (str2int(&final_pulse_val.rs, &final_pulse) != 0)
1458 1458
 		{
1459
-			LM_ERR("final_pulse value is invalid: %.*s", final_pulse_val.rs.len, final_pulse_val.rs.s);
1459
+			LM_ERR("final_pulse value is invalid: %.*s\n", final_pulse_val.rs.len, final_pulse_val.rs.s);
1460 1460
 			return -1;
1461 1461
 		}
1462 1462
 
1463 1463
 		if (credit < cost_per_second) {
1464
-			LM_ERR("Not enough credit to start the call: credit=[%f] < cost_per_sec=[%f]", credit, cost_per_second);
1464
+			LM_ERR("Not enough credit to start the call: credit=[%f] < cost_per_sec=[%f]\n", credit, cost_per_second);
1465 1465
 			return -1;
1466 1466
 		}
1467 1467
 
... ...
@@ -1690,7 +1690,7 @@ static int set_max_time(struct sip_msg* msg, char* str_pv_client, char* str_pv_m
1690 1690
 
1691 1691
 	if (parse_headers(msg, HDR_CALLID_F, 0) != 0)
1692 1692
 	{
1693
-		LM_ERR("Error parsing Call-ID");
1693
+		LM_ERR("Error parsing Call-ID\n");
1694 1694
 		return -1;
1695 1695
 	}
1696 1696
 
... ...
@@ -171,7 +171,7 @@ void rpc_check_client_stats(rpc_t* rpc, void* ctx)
171 171
 	return;
172 172
 
173 173
 nomem:
174
-	LM_ERR("No more pkg memory");
174
+	LM_ERR("No more pkg memory\n");
175 175
 	rpc->fault(ctx, 500, "No more memory\n");
176 176
 }
177 177
 
... ...
@@ -251,7 +251,7 @@ static int iterate_over_table(hash_tables_t *hts, str *result, credit_type_t typ
251 251
 	return 0;
252 252
 
253 253
 nomem:
254
-	LM_ERR("No more pkg memory");
254
+	LM_ERR("No more pkg memory\n");
255 255
 	return -1;
256 256
 }
257 257
 
... ...
@@ -36,28 +36,28 @@ int sel_root(str* res, select_t* s, struct sip_msg* msg)  /* dummy */
36 36
 
37 37
 int sel_channels(str* res, select_t* s, struct sip_msg* msg)
38 38
 {
39
-	LM_DBG("sel_channels");
39
+	LM_DBG("sel_channels\n");
40 40
 
41 41
 	return 0;
42 42
 }
43 43
 
44 44
 int sel_channels_count(str* res, select_t* s, struct sip_msg* msg)
45 45
 {
46
-	LM_DBG("sel_channels_count for [%.*s]",  s->params[2].v.s.len, s->params[2].v.s.s);
46
+	LM_DBG("sel_channels_count for [%.*s]\n",  s->params[2].v.s.len, s->params[2].v.s.s);
47 47
 
48 48
 	credit_data_t *credit_data	= NULL;
49 49
 	int value			= 0;
50 50
 
51 51
 	if (s->params[2].v.s.len <= 0)
52 52
 	{
53
-		LM_ERR("Client must be specified");
53
+		LM_ERR("Client must be specified\n");
54 54
 		return -1;
55 55
 	}
56 56
 
57 57
 	if (try_get_credit_data_entry(&s->params[2].v.s, &credit_data) == 0)
58 58
 		value = credit_data->number_of_calls;
59 59
 	else
60
-		LM_DBG("Client [%.*s] not found", s->params[2].v.s.len, s->params[2].v.s.s);
60
+		LM_DBG("Client [%.*s] not found\n", s->params[2].v.s.len, s->params[2].v.s.s);
61 61
 
62 62
 	res->s 	= int2str(value, &res->len);
63 63