Merge lp:~kklimonda/couchdb-glib/clean-debug into lp:couchdb-glib

Proposed by Krzysztof Klimonda
Status: Merged
Merge reported by: Rodrigo Moya
Merged at revision: not available
Proposed branch: lp:~kklimonda/couchdb-glib/clean-debug
Merge into: lp:couchdb-glib
Diff against target: 78 lines (+10/-5)
3 files modified
couchdb-glib/Makefile.am (+2/-1)
couchdb-glib/couchdb-session.c (+7/-3)
couchdb-glib/xmalloc.c (+1/-1)
To merge this branch: bzr merge lp:~kklimonda/couchdb-glib/clean-debug
Reviewer Review Type Date Requested Status
Rodrigo Moya (community) Approve
Review via email: mp+34197@code.launchpad.net

Description of the change

Don't set up the custom log_handler for all debug messages. Instead define "Couchdb-GLib" log domain and handle only messages related to library itself.

To post a comment you must log in.
249. By Krzysztof Klimonda

don't translate libauth critical message

Revision history for this message
Rodrigo Moya (rodrigo-moya) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'couchdb-glib/Makefile.am'
--- couchdb-glib/Makefile.am 2010-08-27 19:00:17 +0000
+++ couchdb-glib/Makefile.am 2010-08-31 13:46:00 +0000
@@ -9,7 +9,8 @@
9endif9endif
1010
11INCLUDES = \11INCLUDES = \
12 $(COUCHDB_GLIB_CFLAGS)12 $(COUCHDB_GLIB_CFLAGS) \
13 -DG_LOG_DOMAIN=\"Couchdb-GLib\"
1314
14lib_LTLIBRARIES = libcouchdb-glib-1.0.la15lib_LTLIBRARIES = libcouchdb-glib-1.0.la
1516
1617
=== modified file 'couchdb-glib/couchdb-session.c'
--- couchdb-glib/couchdb-session.c 2010-08-31 11:55:28 +0000
+++ couchdb-glib/couchdb-session.c 2010-08-31 13:46:00 +0000
@@ -193,7 +193,7 @@
193 session->priv->credentials = NULL;193 session->priv->credentials = NULL;
194194
195#ifdef DEBUG_MESSAGES195#ifdef DEBUG_MESSAGES
196 g_log_set_handler (NULL, G_LOG_LEVEL_DEBUG, debug_message, NULL);196 g_log_set_handler ("Couchdb-GLib", G_LOG_LEVEL_DEBUG, debug_message, NULL);
197#endif197#endif
198}198}
199199
@@ -562,7 +562,9 @@
562562
563 if (retrying) {563 if (retrying) {
564 g_signal_emit_by_name (session, COUCHDB_SIGNAL_AUTHENTICATION_FAILED, NULL);564 g_signal_emit_by_name (session, COUCHDB_SIGNAL_AUTHENTICATION_FAILED, NULL);
565#ifdef DEBUG_MESSAGES
565 g_debug ("Authentication failed!");566 g_debug ("Authentication failed!");
567#endif
566 return FALSE;568 return FALSE;
567 }569 }
568570
@@ -664,7 +666,9 @@
664 }666 }
665667
666 if (str && str->len > 0) {668 if (str && str->len > 0) {
669#ifdef DEBUG_MESSAGES
667 g_debug ("Response body: %s", str->str);670 g_debug ("Response body: %s", str->str);
671#endif
668 if (!json_parser_load_from_data (json_parser,672 if (!json_parser_load_from_data (json_parser,
669 (const gchar *) str->str,673 (const gchar *) str->str,
670 str->len,674 str->len,
@@ -726,8 +730,8 @@
726 }730 }
727 }731 }
728732
729 g_debug ("Sending %s to %s... with headers\n: ", method, url);
730#ifdef DEBUG_MESSAGES733#ifdef DEBUG_MESSAGES
734 g_debug ("Sending %s to %s... with headers: ", method, url);
731 soup_message_headers_foreach (http_message->request_headers,735 soup_message_headers_foreach (http_message->request_headers,
732 (SoupMessageHeadersForeachFunc) debug_print_headers,736 (SoupMessageHeadersForeachFunc) debug_print_headers,
733 NULL);737 NULL);
@@ -763,7 +767,7 @@
763767
764 couchdb_env_debug_messages = g_getenv(COUCHDB_ENV_DEBUG_MESSAGES);768 couchdb_env_debug_messages = g_getenv(COUCHDB_ENV_DEBUG_MESSAGES);
765 if (couchdb_env_debug_messages != NULL) {769 if (couchdb_env_debug_messages != NULL) {
766 g_print ("couchdb-glib:DEBUG: %s\n", message);770 g_print ("%s-DEBUG: %s\n", log_domain, message);
767 }771 }
768}772}
769#endif773#endif
770774
=== modified file 'couchdb-glib/xmalloc.c'
--- couchdb-glib/xmalloc.c 2010-01-15 10:09:48 +0000
+++ couchdb-glib/xmalloc.c 2010-08-31 13:46:00 +0000
@@ -86,7 +86,7 @@
86 {86 {
87 /* possible revisions: release some memory and re-try, print87 /* possible revisions: release some memory and re-try, print
88 more information (e.g. line number of input file) */88 more information (e.g. line number of input file) */
89 g_debug(_("liboauth: Memory exhausted"));89 g_critical("liboauth: Memory exhausted");
90 exit(1);90 exit(1);
91 }91 }
92 return p;92 return p;

Subscribers

People subscribed via source and target branches