[libgdata] [core] Added error domain



commit 953d0c148e412b45bd7f1d0e8f36309f256d131f
Author: Philip Withnall <philip tecnocode co uk>
Date:   Sun Aug 2 19:57:28 2009 +0100

    [core] Added error domain
    
    Added an error domain ("libgdata") and made all "unhandled element" messages
    into proper messages, rather than warnings. This means that all command line
    output of libgdata can now be redirected so it doesn't mess up command line
    applications.

 gdata/Makefile.am                                |    1 +
 gdata/services/picasaweb/gdata-picasaweb-album.c |    2 +-
 gdata/services/youtube/gdata-youtube-service.c   |    2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gdata/Makefile.am b/gdata/Makefile.am
index 6af6f52..a176d92 100644
--- a/gdata/Makefile.am
+++ b/gdata/Makefile.am
@@ -75,6 +75,7 @@ libgdata_la_SOURCES = \
 libgdata_la_CPPFLAGS = \
 	-I$(top_srcdir)			\
 	-I$(top_srcdir)/gdata		\
+	-DG_LOG_DOMAIN=\"libgdata\"	\
 	$(DISABLE_DEPRECATED)		\
 	$(AM_CPPFLAGS)
 
diff --git a/gdata/services/picasaweb/gdata-picasaweb-album.c b/gdata/services/picasaweb/gdata-picasaweb-album.c
index 5289b5f..856506f 100644
--- a/gdata/services/picasaweb/gdata-picasaweb-album.c
+++ b/gdata/services/picasaweb/gdata-picasaweb-album.c
@@ -361,7 +361,7 @@ notify_rights_cb (GDataPicasaWebAlbum *self, GParamSpec *pspec, gpointer user_da
 		gdata_picasaweb_album_set_visibility (self, GDATA_PICASAWEB_PRIVATE);
 	} else {
 		/* Print out a warning and leave the visibility as it is */
-		g_warning ("Unknown <rights> or <gd:access> value: %s", rights);
+		g_message ("Unknown <rights> or <gd:access> value: %s", rights);
 	}
 
 	g_signal_handlers_unblock_by_func (self, notify_visibility_cb, NULL);
diff --git a/gdata/services/youtube/gdata-youtube-service.c b/gdata/services/youtube/gdata-youtube-service.c
index a685d9f..b76d08d 100644
--- a/gdata/services/youtube/gdata-youtube-service.c
+++ b/gdata/services/youtube/gdata-youtube-service.c
@@ -282,7 +282,7 @@ parse_error_response (GDataService *self, GDataServiceError error_type, guint st
 				location = xmlNodeListGetString (doc, child_node->children, TRUE);
 			else if (xmlStrcmp (child_node->name, (xmlChar*) "internalReason") != 0) {
 				/* Unknown element (ignore internalReason) */
-				g_warning ("Unhandled <error/%s> element.", child_node->name);
+				g_message ("Unhandled <error/%s> element.", child_node->name);
 
 				xmlFree (domain);
 				xmlFree (code);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]