Browse code

cosmetical changes (logging)

Vaclav Kubart authored on 03/02/2006 16:25:58
Showing 8 changed files
... ...
@@ -30,7 +30,7 @@ int cds_initialize()
30 30
 		return 0;
31 31
 	}
32 32
 	else {
33
-		DEBUG_LOG("cds_initialize(): init the content\n");
33
+		DEBUG_LOG("init the content\n");
34 34
 		
35 35
 		/* !!! put the real initialization here !!! */
36 36
 		res = reference_counter_initialize();
... ...
@@ -44,7 +44,7 @@ void cds_cleanup()
44 44
 {
45 45
 	if (init) {
46 46
 		if (--init->init_cnt == 0) {
47
-			DEBUG_LOG("cds_cleanup(): cleaning the content\n");
47
+			DEBUG_LOG("cleaning the content\n");
48 48
 			
49 49
 			/* !!! put the real destruction here !!! */
50 50
 			reference_counter_cleanup();
... ...
@@ -41,10 +41,10 @@
41 41
 
42 42
 #include "dprint.h"
43 43
 
44
-#define ERROR_LOG(a,args...)		LOG(L_ERR,a,##args)
45
-#define DEBUG_LOG(a,args...)		LOG(L_DBG,a,##args)
46
-#define TRACE_LOG(a,args...)		LOG(L_DBG,a,##args)
47
-#define WARN_LOG(a,args...)			LOG(L_WARN,a,##args)
44
+#define ERROR_LOG(a,args...)		ERR(a,##args)
45
+#define DEBUG_LOG(a,args...)		DBG(a,##args)
46
+#define TRACE_LOG(a,args...)		DBG(a,##args)
47
+#define WARN_LOG(a,args...)			WARN(a,##args)
48 48
 #define FLUSH_LOG()					do{}while(0)
49 49
 
50 50
 #endif
... ...
@@ -61,7 +61,7 @@ void *debug_malloc(int size, const char *file, int line)
61 61
 	m = malloc(size);
62 62
 #endif
63 63
 	write_debug("ALLOC %p size %u from %s(%d)\n", m, size, file, line);
64
-	/* LOG(L_INFO, "debug_malloc(): %p\n", m); */
64
+	/* LOG(L_INFO, "%p\n", m); */
65 65
 	return m;
66 66
 }
67 67
 
... ...
@@ -54,7 +54,7 @@ int qsa_initialize()
54 54
 		return 0;
55 55
 	}
56 56
 	else {
57
-		DEBUG_LOG("qsa_initialize(): init the content\n");
57
+		DEBUG_LOG("init the content\n");
58 58
 
59 59
 		/* !!! put the real initialization here !!! */
60 60
 		init->dm = create_domain_maintainer();
... ...
@@ -72,7 +72,7 @@ void qsa_cleanup()
72 72
 {
73 73
 	if (init) {
74 74
 		if (--init->init_cnt == 0) {
75
-			DEBUG_LOG("qsa_cleanup(): cleaning the content\n");
75
+			DEBUG_LOG("cleaning the content\n");
76 76
 			
77 77
 			/* !!! put the real destruction here !!! */
78 78
 			if (init->dm) destroy_domain_maintainer(init->dm);
... ...
@@ -35,8 +35,6 @@
35 35
 
36 36
 static void doc_add_tuple_note(dstring_t *buf, presence_note_t *n)
37 37
 {
38
-	DEBUG_LOG("doc_add_tuple_note()\n");
39
-	
40 38
 	dstr_append_zt(buf, "\t\t\t<note>");
41 39
 	dstr_append_str(buf, &n->value);	
42 40
 	dstr_append_zt(buf, "</note>\r\n");
... ...
@@ -62,8 +60,6 @@ static void doc_add_tuple(dstring_t *buf, presentity_info_t *p, presence_tuple_i
62 60
 	presence_note_t *n;
63 61
 	char tmp[32];
64 62
 	
65
-	DEBUG_LOG("doc_add_tuple()\n");
66
-	
67 63
 	dstr_append_zt(buf, "\t<atom id=\"");
68 64
 	dstr_append_str(buf, &t->id);
69 65
 	dstr_append_zt(buf, "\">\r\n");
... ...
@@ -92,8 +88,6 @@ static void doc_add_tuple(dstring_t *buf, presentity_info_t *p, presence_tuple_i
92 88
 
93 89
 static void doc_add_empty_tuple(dstring_t *buf, presentity_info_t *p)
94 90
 {
95
-	DEBUG_LOG("doc_add_empty_tuple()\n");
96
-	
97 91
 	dstr_append_zt(buf, "\t<atom id=\"none\">\r\n");
98 92
 	
99 93
 	dstr_append_zt(buf, "\t\t<address uri=\"");
... ...
@@ -111,7 +105,6 @@ static void doc_add_presentity(dstring_t *buf, presentity_info_t *p)
111 105
 	presence_tuple_info_t *t;
112 106
 	/* presence_note_t *n; */
113 107
 
114
-	DEBUG_LOG("doc_add_presentity()\n");
115 108
 	dstr_append_zt(buf, "<presence>\r\n");
116 109
 	/* !!! there SHOULD be pres URI of presentity !!! */
117 110
 	dstr_append_zt(buf, "<presentity uri=\"");
... ...
@@ -119,7 +112,6 @@ static void doc_add_presentity(dstring_t *buf, presentity_info_t *p)
119 112
 	dstr_append_str(buf, &p->presentity);
120 113
 	dstr_append_zt(buf, ";method=SUBSCRIBE\"/>\r\n");
121 114
 	
122
-	DEBUG_LOG("doc_add_presentity(): adding tuples\n");
123 115
 	t = p->first_tuple;
124 116
 	if (!t) doc_add_empty_tuple(buf, p);
125 117
 	while (t) {
... ...
@@ -127,7 +119,7 @@ static void doc_add_presentity(dstring_t *buf, presentity_info_t *p)
127 119
 		t = t->next;
128 120
 	}
129 121
 	
130
-/*	DEBUG_LOG("doc_add_presentity(): adding notes\n");
122
+/*	
131 123
 	n = p->first_note;
132 124
 	while (n) {
133 125
 		doc_add_note(buf, p, n);
... ...
@@ -75,7 +75,7 @@ int get_pres_rules(const char *xcap_root, const str_t *uri, xcap_query_t *xcap_p
75 75
 	xcap.uri = xcap_uri_for_pres_rules(xcap_root, uri);
76 76
 	res = xcap_query(&xcap, &data, &dsize);
77 77
 	if (res != RES_OK) {
78
-		ERROR_LOG("get_pres_rules(): XCAP problems for uri \'%s\'\n", xcap.uri ? xcap.uri: "???");
78
+		DEBUG_LOG("XCAP problems for uri \'%s\'\n", xcap.uri ? xcap.uri: "???");
79 79
 		if (data) cds_free(data);
80 80
 		return RES_XCAP_QUERY_ERR;
81 81
 	}
... ...
@@ -554,7 +554,7 @@ int get_rls(const char *xcap_root, const str_t *uri, xcap_query_t *xcap_params,
554 554
 	/* DEBUG_LOG("XCAP uri \'%s\'\n", xcap.uri ? xcap.uri: "???"); */
555 555
 	res = xcap_query(&xcap, &data, &dsize);
556 556
 	if (res != 0) {
557
-		ERROR_LOG("get_rls(): XCAP problems for uri \'%s\'\n", xcap.uri ? xcap.uri: "???");
557
+		ERROR_LOG("XCAP problems for uri \'%s\'\n", xcap.uri ? xcap.uri: "???");
558 558
 		if (data) {
559 559
 			cds_free(data);
560 560
 		}
... ...
@@ -623,7 +623,7 @@ int get_rls_from_full_doc(const char *xcap_root, const str_t *uri, xcap_query_t
623 623
 	DEBUG_LOG("XCAP uri \'%s\'\n", xcap.uri ? xcap.uri: "???");
624 624
 	res = xcap_query(&xcap, &data, &dsize);
625 625
 	if (res != 0) {
626
-		ERROR_LOG("get_rls(): XCAP problems for uri \'%s\'\n", xcap.uri ? xcap.uri: "???");
626
+		ERROR_LOG("XCAP problems for uri \'%s\'\n", xcap.uri ? xcap.uri: "???");
627 627
 		if (data) {
628 628
 			cds_free(data);
629 629
 		}
... ...
@@ -722,10 +722,10 @@ int get_resource_list_as_rls(const char *xcap_root, const str_t *user, xcap_quer
722 722
 
723 723
 	/* get basic document */
724 724
 	xcap.uri = xcap_uri_for_resource_list(xcap_root, user);
725
-	DEBUG_LOG("get_resource_list_as_rls(): XCAP uri \'%s\'\n", xcap.uri ? xcap.uri: "???");
725
+	DEBUG_LOG("XCAP uri \'%s\'\n", xcap.uri ? xcap.uri: "???");
726 726
 	res = xcap_query(&xcap, &data, &dsize);
727 727
 	if (res != 0) {
728
-		ERROR_LOG("get_rls(): XCAP problems for uri \'%s\'\n", xcap.uri ? xcap.uri: "???");
728
+		ERROR_LOG("XCAP problems for uri \'%s\'\n", xcap.uri ? xcap.uri: "???");
729 729
 		if (data) {
730 730
 			cds_free(data);
731 731
 		}
... ...
@@ -157,7 +157,6 @@ int read_list(xmlNode *list_node, list_t **dst, int read_content_only)
157 157
 	xmlNode *n;
158 158
 	list_content_t *l, *last_l;
159 159
 	
160
-	DEBUG_LOG("read_list(): called\n");
161 160
 	/* allocate memory and prepare empty node */
162 161
 	if (!dst) return -1;
163 162
 	*dst = (list_t*)cds_malloc(sizeof(list_t));