浏览代码

cosmetical changes (logging)

Vaclav Kubart 19 年之前
父节点
当前提交
6d91bebf8d
共有 8 个文件被更改,包括 15 次插入24 次删除
  1. 2 2
      lib/cds/cds.c
  2. 4 4
      lib/cds/logger.h
  3. 1 1
      lib/cds/memory.c
  4. 2 2
      lib/presence/qsa.c
  5. 1 9
      lib/presence/xpidf.c
  6. 1 1
      lib/xcap/pres_rules.c
  7. 4 4
      lib/xcap/resource_list.c
  8. 0 1
      lib/xcap/resource_lists_parser.c

+ 2 - 2
lib/cds/cds.c

@@ -30,7 +30,7 @@ int cds_initialize()
 		return 0;
 	}
 	else {
-		DEBUG_LOG("cds_initialize(): init the content\n");
+		DEBUG_LOG("init the content\n");
 		
 		/* !!! put the real initialization here !!! */
 		res = reference_counter_initialize();
@@ -44,7 +44,7 @@ void cds_cleanup()
 {
 	if (init) {
 		if (--init->init_cnt == 0) {
-			DEBUG_LOG("cds_cleanup(): cleaning the content\n");
+			DEBUG_LOG("cleaning the content\n");
 			
 			/* !!! put the real destruction here !!! */
 			reference_counter_cleanup();

+ 4 - 4
lib/cds/logger.h

@@ -41,10 +41,10 @@
 
 #include "dprint.h"
 
-#define ERROR_LOG(a,args...)		LOG(L_ERR,a,##args)
-#define DEBUG_LOG(a,args...)		LOG(L_DBG,a,##args)
-#define TRACE_LOG(a,args...)		LOG(L_DBG,a,##args)
-#define WARN_LOG(a,args...)			LOG(L_WARN,a,##args)
+#define ERROR_LOG(a,args...)		ERR(a,##args)
+#define DEBUG_LOG(a,args...)		DBG(a,##args)
+#define TRACE_LOG(a,args...)		DBG(a,##args)
+#define WARN_LOG(a,args...)			WARN(a,##args)
 #define FLUSH_LOG()					do{}while(0)
 
 #endif

+ 1 - 1
lib/cds/memory.c

@@ -61,7 +61,7 @@ void *debug_malloc(int size, const char *file, int line)
 	m = malloc(size);
 #endif
 	write_debug("ALLOC %p size %u from %s(%d)\n", m, size, file, line);
-	/* LOG(L_INFO, "debug_malloc(): %p\n", m); */
+	/* LOG(L_INFO, "%p\n", m); */
 	return m;
 }
 

+ 2 - 2
lib/presence/qsa.c

@@ -54,7 +54,7 @@ int qsa_initialize()
 		return 0;
 	}
 	else {
-		DEBUG_LOG("qsa_initialize(): init the content\n");
+		DEBUG_LOG("init the content\n");
 
 		/* !!! put the real initialization here !!! */
 		init->dm = create_domain_maintainer();
@@ -72,7 +72,7 @@ void qsa_cleanup()
 {
 	if (init) {
 		if (--init->init_cnt == 0) {
-			DEBUG_LOG("qsa_cleanup(): cleaning the content\n");
+			DEBUG_LOG("cleaning the content\n");
 			
 			/* !!! put the real destruction here !!! */
 			if (init->dm) destroy_domain_maintainer(init->dm);

+ 1 - 9
lib/presence/xpidf.c

@@ -35,8 +35,6 @@
 
 static void doc_add_tuple_note(dstring_t *buf, presence_note_t *n)
 {
-	DEBUG_LOG("doc_add_tuple_note()\n");
-	
 	dstr_append_zt(buf, "\t\t\t<note>");
 	dstr_append_str(buf, &n->value);	
 	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
 	presence_note_t *n;
 	char tmp[32];
 	
-	DEBUG_LOG("doc_add_tuple()\n");
-	
 	dstr_append_zt(buf, "\t<atom id=\"");
 	dstr_append_str(buf, &t->id);
 	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
 
 static void doc_add_empty_tuple(dstring_t *buf, presentity_info_t *p)
 {
-	DEBUG_LOG("doc_add_empty_tuple()\n");
-	
 	dstr_append_zt(buf, "\t<atom id=\"none\">\r\n");
 	
 	dstr_append_zt(buf, "\t\t<address uri=\"");
@@ -111,7 +105,6 @@ static void doc_add_presentity(dstring_t *buf, presentity_info_t *p)
 	presence_tuple_info_t *t;
 	/* presence_note_t *n; */
 
-	DEBUG_LOG("doc_add_presentity()\n");
 	dstr_append_zt(buf, "<presence>\r\n");
 	/* !!! there SHOULD be pres URI of presentity !!! */
 	dstr_append_zt(buf, "<presentity uri=\"");
@@ -119,7 +112,6 @@ static void doc_add_presentity(dstring_t *buf, presentity_info_t *p)
 	dstr_append_str(buf, &p->presentity);
 	dstr_append_zt(buf, ";method=SUBSCRIBE\"/>\r\n");
 	
-	DEBUG_LOG("doc_add_presentity(): adding tuples\n");
 	t = p->first_tuple;
 	if (!t) doc_add_empty_tuple(buf, p);
 	while (t) {
@@ -127,7 +119,7 @@ static void doc_add_presentity(dstring_t *buf, presentity_info_t *p)
 		t = t->next;
 	}
 	
-/*	DEBUG_LOG("doc_add_presentity(): adding notes\n");
+/*	
 	n = p->first_note;
 	while (n) {
 		doc_add_note(buf, p, n);

+ 1 - 1
lib/xcap/pres_rules.c

@@ -75,7 +75,7 @@ int get_pres_rules(const char *xcap_root, const str_t *uri, xcap_query_t *xcap_p
 	xcap.uri = xcap_uri_for_pres_rules(xcap_root, uri);
 	res = xcap_query(&xcap, &data, &dsize);
 	if (res != RES_OK) {
-		ERROR_LOG("get_pres_rules(): XCAP problems for uri \'%s\'\n", xcap.uri ? xcap.uri: "???");
+		DEBUG_LOG("XCAP problems for uri \'%s\'\n", xcap.uri ? xcap.uri: "???");
 		if (data) cds_free(data);
 		return RES_XCAP_QUERY_ERR;
 	}

+ 4 - 4
lib/xcap/resource_list.c

@@ -554,7 +554,7 @@ int get_rls(const char *xcap_root, const str_t *uri, xcap_query_t *xcap_params,
 	/* DEBUG_LOG("XCAP uri \'%s\'\n", xcap.uri ? xcap.uri: "???"); */
 	res = xcap_query(&xcap, &data, &dsize);
 	if (res != 0) {
-		ERROR_LOG("get_rls(): XCAP problems for uri \'%s\'\n", xcap.uri ? xcap.uri: "???");
+		ERROR_LOG("XCAP problems for uri \'%s\'\n", xcap.uri ? xcap.uri: "???");
 		if (data) {
 			cds_free(data);
 		}
@@ -623,7 +623,7 @@ int get_rls_from_full_doc(const char *xcap_root, const str_t *uri, xcap_query_t
 	DEBUG_LOG("XCAP uri \'%s\'\n", xcap.uri ? xcap.uri: "???");
 	res = xcap_query(&xcap, &data, &dsize);
 	if (res != 0) {
-		ERROR_LOG("get_rls(): XCAP problems for uri \'%s\'\n", xcap.uri ? xcap.uri: "???");
+		ERROR_LOG("XCAP problems for uri \'%s\'\n", xcap.uri ? xcap.uri: "???");
 		if (data) {
 			cds_free(data);
 		}
@@ -722,10 +722,10 @@ int get_resource_list_as_rls(const char *xcap_root, const str_t *user, xcap_quer
 
 	/* get basic document */
 	xcap.uri = xcap_uri_for_resource_list(xcap_root, user);
-	DEBUG_LOG("get_resource_list_as_rls(): XCAP uri \'%s\'\n", xcap.uri ? xcap.uri: "???");
+	DEBUG_LOG("XCAP uri \'%s\'\n", xcap.uri ? xcap.uri: "???");
 	res = xcap_query(&xcap, &data, &dsize);
 	if (res != 0) {
-		ERROR_LOG("get_rls(): XCAP problems for uri \'%s\'\n", xcap.uri ? xcap.uri: "???");
+		ERROR_LOG("XCAP problems for uri \'%s\'\n", xcap.uri ? xcap.uri: "???");
 		if (data) {
 			cds_free(data);
 		}

+ 0 - 1
lib/xcap/resource_lists_parser.c

@@ -157,7 +157,6 @@ int read_list(xmlNode *list_node, list_t **dst, int read_content_only)
 	xmlNode *n;
 	list_content_t *l, *last_l;
 	
-	DEBUG_LOG("read_list(): called\n");
 	/* allocate memory and prepare empty node */
 	if (!dst) return -1;
 	*dst = (list_t*)cds_malloc(sizeof(list_t));