summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2005-11-04 19:07:38 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2005-11-04 19:07:38 +0000
commitae33c0ab8689a53619fe8bdfcb17e7f52395f071 (patch)
treeaac7de54ab8548b6fcc620c64d865122030b34d5
parent8cf4ab38f14c4b780860821b03e5e2feae4162bd (diff)
downloadglib-ae33c0ab8689a53619fe8bdfcb17e7f52395f071.tar.gz
add new GDebugFlag for fatal_criticals handle G_DEBUG=fatal_criticals, to
2005-11-04 Matthias Clasen <mclasen@redhat.com> * glib/gdebug.h: add new GDebugFlag for fatal_criticals * glib/gmessages.c: (_g_debug_init): handle G_DEBUG=fatal_criticals, to help find critical warnings in applications. (#320017, Vincent Untz)
-rw-r--r--ChangeLog7
-rw-r--r--ChangeLog.pre-2-107
-rw-r--r--ChangeLog.pre-2-127
-rw-r--r--docs/reference/ChangeLog4
-rw-r--r--docs/reference/glib/running.sgml11
-rw-r--r--glib/gdebug.h3
-rw-r--r--glib/gmessages.c12
7 files changed, 48 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 33b8a94b4..be492a777 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-11-04 Matthias Clasen <mclasen@redhat.com>
+
+ * glib/gdebug.h: add new GDebugFlag for fatal_criticals
+ * glib/gmessages.c: (_g_debug_init): handle G_DEBUG=fatal_criticals,
+ to help find critical warnings in applications. (#320017,
+ Vincent Untz)
+
2005-10-29 Matthias Clasen <mclasen@redhat.com>
* tests/convert-test.c: Add some tests for conversions between
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index 33b8a94b4..be492a777 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,3 +1,10 @@
+2005-11-04 Matthias Clasen <mclasen@redhat.com>
+
+ * glib/gdebug.h: add new GDebugFlag for fatal_criticals
+ * glib/gmessages.c: (_g_debug_init): handle G_DEBUG=fatal_criticals,
+ to help find critical warnings in applications. (#320017,
+ Vincent Untz)
+
2005-10-29 Matthias Clasen <mclasen@redhat.com>
* tests/convert-test.c: Add some tests for conversions between
diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12
index 33b8a94b4..be492a777 100644
--- a/ChangeLog.pre-2-12
+++ b/ChangeLog.pre-2-12
@@ -1,3 +1,10 @@
+2005-11-04 Matthias Clasen <mclasen@redhat.com>
+
+ * glib/gdebug.h: add new GDebugFlag for fatal_criticals
+ * glib/gmessages.c: (_g_debug_init): handle G_DEBUG=fatal_criticals,
+ to help find critical warnings in applications. (#320017,
+ Vincent Untz)
+
2005-10-29 Matthias Clasen <mclasen@redhat.com>
* tests/convert-test.c: Add some tests for conversions between
diff --git a/docs/reference/ChangeLog b/docs/reference/ChangeLog
index 2c9189a62..f206768c9 100644
--- a/docs/reference/ChangeLog
+++ b/docs/reference/ChangeLog
@@ -1,3 +1,7 @@
+2005-11-04 Matthias Clasen <mclasen@redhat.com>
+
+ * glib/running.sgml: Document fatal_criticals.
+
2005-10-03 Matthias Clasen <mclasen@redhat.com>
* === Released 2.8.3 ===
diff --git a/docs/reference/glib/running.sgml b/docs/reference/glib/running.sgml
index 8cd4d58ef..f17d68c88 100644
--- a/docs/reference/glib/running.sgml
+++ b/docs/reference/glib/running.sgml
@@ -65,7 +65,16 @@ variables like <envar>LANG</envar>, <envar>PATH</envar> or <envar>HOME</envar>.
<varlistentry>
<term>fatal_warnings</term>
<listitem><para>Causes GLib to abort the program at the first call
- to <link linkend="g-warning">g_warning</link>(). This option is
+ to <link linkend="g-warning">g_warning</link>() or
+ <link linkend="g-critical">g_critical</link>(). This option is
+ special in that it doesn't require GLib to be configured with
+ debugging support.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>fatal_criticals</term>
+ <listitem><para>Causes GLib to abort the program at the first call
+ to <link linkend="g-critical">g_critical</link>(). This option is
special in that it doesn't require GLib to be configured with
debugging support.</para>
</listitem>
diff --git a/glib/gdebug.h b/glib/gdebug.h
index 67a8af8e8..8e172b72c 100644
--- a/glib/gdebug.h
+++ b/glib/gdebug.h
@@ -30,7 +30,8 @@
G_BEGIN_DECLS
typedef enum {
- G_DEBUG_FATAL_WARNINGS = 1 << 0
+ G_DEBUG_FATAL_WARNINGS = 1 << 0,
+ G_DEBUG_FATAL_CRITICALS = 1 << 1
} GDebugFlag;
diff --git a/glib/gmessages.c b/glib/gmessages.c
index 8f63b3e56..38298bfdc 100644
--- a/glib/gmessages.c
+++ b/glib/gmessages.c
@@ -1069,7 +1069,8 @@ _g_debug_init (void)
if (val != NULL)
{
static const GDebugKey keys[] = {
- {"fatal_warnings", G_DEBUG_FATAL_WARNINGS}
+ {"fatal_warnings", G_DEBUG_FATAL_WARNINGS},
+ {"fatal_criticals", G_DEBUG_FATAL_CRITICALS}
};
_g_debug_flags = g_parse_debug_string (val, keys, G_N_ELEMENTS (keys));
@@ -1083,6 +1084,15 @@ _g_debug_init (void)
fatal_mask |= G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL;
g_log_set_always_fatal (fatal_mask);
}
+
+ if (_g_debug_flags & G_DEBUG_FATAL_CRITICALS)
+ {
+ GLogLevelFlags fatal_mask;
+
+ fatal_mask = g_log_set_always_fatal (G_LOG_FATAL_MASK);
+ fatal_mask |= G_LOG_LEVEL_CRITICAL;
+ g_log_set_always_fatal (fatal_mask);
+ }
}
#define __G_MESSAGES_C__