From 5328c70938871f867387386c2a7c88254033b160 Mon Sep 17 00:00:00 2001 From: Jose Dapena Paz Date: Sun, 31 May 2009 19:41:43 +0200 Subject: [PATCH] g_debug should not dump output if debug flags or parameters are out. --- src/modest-init.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/modest-init.c b/src/modest-init.c index b412c33..a4394df 100644 --- a/src/modest-init.c +++ b/src/modest-init.c @@ -564,11 +564,27 @@ init_debug_g_type (void) g_type_init_with_debug_flags (gflags); } +static void +null_log(const gchar* dom, + GLogLevelFlags l, + const gchar* m, + gpointer d) +{ + return; +}; + static void init_debug_logging (void) { ModestRuntimeDebugFlags mflags; mflags = modest_runtime_get_debug_flags (); + +#ifndef DEBUG + if (! (mflags & MODEST_RUNTIME_DEBUG_CODE)) { + g_log_set_handler (NULL, G_LOG_LEVEL_DEBUG, null_log, NULL); + } +#endif + if (mflags & MODEST_RUNTIME_DEBUG_ABORT_ON_WARNING) g_log_set_always_fatal (G_LOG_LEVEL_ERROR | -- 1.7.9.5