g_debug should not dump output if debug flags or parameters are out.
authorJose Dapena Paz <jdapena@igalia.com>
Sun, 31 May 2009 17:41:43 +0000 (19:41 +0200)
committerJose Dapena Paz <jdapena@igalia.com>
Sun, 31 May 2009 17:41:43 +0000 (19:41 +0200)
src/modest-init.c

index b412c33..a4394df 100644 (file)
@@ -564,11 +564,27 @@ init_debug_g_type (void)
        g_type_init_with_debug_flags (gflags);
 }
 
        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 ();
 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 |
        
        if (mflags & MODEST_RUNTIME_DEBUG_ABORT_ON_WARNING)
                g_log_set_always_fatal (G_LOG_LEVEL_ERROR |