[libgsf] xml: don't print warnings about namespace uris by default.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgsf] xml: don't print warnings about namespace uris by default.
- Date: Wed, 28 Jul 2010 17:16:26 +0000 (UTC)
commit 488f4cff8a555e6c323b782c5d9b6537d8519edc
Author: Morten Welinder <terra gnome org>
Date: Wed Jul 28 13:15:59 2010 -0400
xml: don't print warnings about namespace uris by default.
ChangeLog | 7 +++++++
NEWS | 3 +++
gsf/gsf-libxml.c | 3 ++-
gsf/gsf-utils.c | 10 ++++++++++
gsf/gsf-utils.h | 3 ++-
5 files changed, 24 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 9cdfdf9..f59f805 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-07-28 Morten Welinder <terra gnome org>
+
+ * gsf/gsf-utils.c (gsf_debug_flag): New function.
+
+ * gsf/gsf-libxml.c (gsf_xml_in_start_element): Don't complain over
+ missing namespace uris unless a debug flag is set.
+
2010-04-07 Morten Welinder <terra gnome org>
* configure.in: Post-release-bump.
diff --git a/NEWS b/NEWS
index 50f6a31..3236982 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
libgsf 1.14.19
+Morten:
+ * Quiet xml parsing a bit.
+
--------------------------------------------------------------------------
libgsf 1.14.18
diff --git a/gsf/gsf-libxml.c b/gsf/gsf-libxml.c
index 2fbba11..f56ddc2 100644
--- a/gsf/gsf-libxml.c
+++ b/gsf/gsf-libxml.c
@@ -703,7 +703,8 @@ gsf_xml_in_start_element (GsfXMLInInternal *state, xmlChar const *name, xmlChar
}
if (NULL == tmp) {
- g_warning ("Unknown namespace uri = '%s'", ns_ptr[1]);
+ if (gsf_debug_flag ("ns"))
+ g_warning ("Unknown namespace uri = '%s'", ns_ptr[1]);
}
}
}
diff --git a/gsf/gsf-utils.c b/gsf/gsf-utils.c
index 4e54b09..d7a7247 100644
--- a/gsf/gsf-utils.c
+++ b/gsf/gsf-utils.c
@@ -79,6 +79,16 @@
#define G_FLOAT_BYTE_ORDER G_BYTE_ORDER
#endif
+gboolean
+gsf_debug_flag (const char *flag)
+{
+ GDebugKey key;
+ key.key = (char *)flag;
+ key.value = 1;
+
+ return g_parse_debug_string (g_getenv ("GSF_DEBUG"), &key, 1) != 0;
+}
+
#ifndef HAVE_G_BASE64_ENCODE
static void base64_init (void);
diff --git a/gsf/gsf-utils.h b/gsf/gsf-utils.h
index c61d7e4..0d18bfd 100644
--- a/gsf/gsf-utils.h
+++ b/gsf/gsf-utils.h
@@ -251,9 +251,10 @@ void gsf_init (void);
void gsf_shutdown (void);
void gsf_init_dynamic (GTypeModule *module);
void gsf_shutdown_dynamic (GTypeModule *module);
+gboolean gsf_debug_flag (const char *flag);
/* Debugging utilities */
- void gsf_mem_dump (guint8 const *ptr, size_t len);
+void gsf_mem_dump (guint8 const *ptr, size_t len);
void gsf_input_dump (GsfInput *input, gboolean dump_as_hex);
/* base64 encoding utilities */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]