From: Jose Dapena Paz Date: Sun, 31 May 2009 17:41:43 +0000 (+0200) Subject: g_debug should not dump output if debug flags or parameters are out. X-Git-Tag: 3.0.17-rc10~35 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=5328c70938871f867387386c2a7c88254033b160 g_debug should not dump output if debug flags or parameters are out. --- 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 |