[gnome-video-arcade] gva_get_debug_flags(): Simplify the logic.
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-video-arcade] gva_get_debug_flags(): Simplify the logic.
- Date: Thu, 23 Jun 2011 00:10:00 +0000 (UTC)
commit 06402e5c38bf4aea8718554a1ea1fee23304dea8
Author: Matthew Barnes <mbarnes redhat com>
Date: Thu Jun 2 14:18:54 2011 -0400
gva_get_debug_flags(): Simplify the logic.
Install log handlers for each debug key in a loop.
src/gva-util.c | 28 +++++++++++++---------------
1 files changed, 13 insertions(+), 15 deletions(-)
---
diff --git a/src/gva-util.c b/src/gva-util.c
index 38b69b2..3152bbe 100644
--- a/src/gva-util.c
+++ b/src/gva-util.c
@@ -176,22 +176,20 @@ gva_get_debug_flags (void)
};
const gchar *env = g_getenv ("GVA_DEBUG");
+ gint ii;
- g_log_set_handler (
- G_LOG_DOMAIN, GVA_DEBUG_MAME,
- (GLogFunc) log_handler, "MAME");
- g_log_set_handler (
- G_LOG_DOMAIN, GVA_DEBUG_SQL,
- (GLogFunc) log_handler, "SQL");
- g_log_set_handler (
- G_LOG_DOMAIN, GVA_DEBUG_IO,
- (GLogFunc) log_handler, "IO");
- g_log_set_handler (
- G_LOG_DOMAIN, GVA_DEBUG_INP,
- (GLogFunc) log_handler, "INP");
- g_log_set_handler (
- G_LOG_DOMAIN, GVA_DEBUG_GST,
- (GLogFunc) log_handler, "GST");
+ for (ii = 0; ii < G_N_ELEMENTS (debug_keys); ii++)
+ {
+ gchar *all_caps;
+
+ all_caps = g_ascii_strup (debug_keys[ii].key, -1);
+
+ g_log_set_handler (
+ G_LOG_DOMAIN, debug_keys[ii].value,
+ (GLogFunc) log_handler, all_caps);
+
+ g_free (all_caps);
+ }
flags = g_parse_debug_string (
(env != NULL) ? env : "", debug_keys,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]