[gitg/gtk3] Added better debugging for gitg-config



commit e3ab4e78ff4db0ef0696a7afbaaa89b84569ebf4
Author: Jesse van den Kieboom <jesse vandenkieboom epfl ch>
Date:   Sun Mar 27 11:21:55 2011 +0200

    Added better debugging for gitg-config

 libgitg/gitg-config.c |   41 +++++++++++++++++++++++++++++++++--------
 libgitg/gitg-debug.c  |    1 +
 libgitg/gitg-debug.h  |    3 ++-
 3 files changed, 36 insertions(+), 9 deletions(-)
---
diff --git a/libgitg/gitg-config.c b/libgitg/gitg-config.c
index 87b68ca..56d2f32 100644
--- a/libgitg/gitg-config.c
+++ b/libgitg/gitg-config.c
@@ -22,6 +22,7 @@
 
 #include "gitg-config.h"
 #include "gitg-shell.h"
+#include "gitg-debug.h"
 
 #define GITG_CONFIG_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object), GITG_TYPE_CONFIG, GitgConfigPrivate))
 
@@ -196,7 +197,10 @@ get_value_global (GitgConfig *config, gchar const *key)
 
 	if (error)
 	{
-		g_warning ("Failed to get config: %s", error->message);
+		gitg_debug (GITG_DEBUG_CONFIG,
+		            "Failed to get config: %s",
+		            error->message);
+
 		g_error_free (error);
 	}
 
@@ -223,7 +227,10 @@ get_value_global_regex (GitgConfig *config,
 
 	if (error)
 	{
-		g_warning ("Failed to get config: %s", error->message);
+		gitg_debug (GITG_DEBUG_CONFIG,
+		            "Failed to get config: %s",
+		            error->message);
+
 		g_error_free (error);
 	}
 
@@ -255,7 +262,10 @@ get_value_local (GitgConfig *config, gchar const *key)
 
 	if (error)
 	{
-		g_warning ("Failed to get config: %s", error->message);
+		gitg_debug (GITG_DEBUG_CONFIG,
+		            "Failed to get config: %s",
+		            error->message);
+
 		g_error_free (error);
 	}
 
@@ -296,7 +306,10 @@ get_value_local_regex (GitgConfig *config,
 
 	if (error)
 	{
-		g_warning ("Failed to get config: %s", error->message);
+		gitg_debug (GITG_DEBUG_CONFIG,
+		            "Failed to get config: %s",
+		            error->message);
+
 		g_error_free (error);
 	}
 
@@ -326,7 +339,10 @@ set_value_global (GitgConfig *config, gchar const *key, gchar const *value)
 
 	if (error)
 	{
-		g_warning ("Failed to get config: %s", error->message);
+		gitg_debug (GITG_DEBUG_CONFIG,
+		            "Failed to get config: %s",
+		            error->message);
+
 		g_error_free (error);
 	}
 
@@ -359,7 +375,10 @@ set_value_local (GitgConfig *config, gchar const *key, gchar const *value)
 
 	if (error)
 	{
-		g_warning ("Failed to set config: %s", error->message);
+		gitg_debug (GITG_DEBUG_CONFIG,
+		            "Failed to set config: %s",
+		            error->message);
+
 		g_error_free (error);
 	}
 
@@ -390,7 +409,10 @@ rename_global (GitgConfig *config, gchar const *old, gchar const *nw)
 
 	if (error)
 	{
-		g_warning ("Failed to rename config: %s", error->message);
+		gitg_debug (GITG_DEBUG_CONFIG,
+		            "Failed to rename config: %s",
+		            error->message);
+
 		g_error_free (error);
 	}
 
@@ -424,7 +446,10 @@ rename_local (GitgConfig *config, gchar const *old, gchar const *nw)
 
 	if (error)
 	{
-		g_warning ("Failed to rename config: %s", error->message);
+		gitg_debug (GITG_DEBUG_CONFIG,
+		            "Failed to rename config: %s",
+		            error->message);
+
 		g_error_free (error);
 	}
 
diff --git a/libgitg/gitg-debug.c b/libgitg/gitg-debug.c
index fb4c45c..6530e7a 100644
--- a/libgitg/gitg-debug.c
+++ b/libgitg/gitg-debug.c
@@ -40,6 +40,7 @@ gitg_debug_init (void)
 	DEBUG_FROM_ENV (GITG_DEBUG_SHELL);
 	DEBUG_FROM_ENV (GITG_DEBUG_SHELL_OUTPUT);
 	DEBUG_FROM_ENV (GITG_DEBUG_CHARSET_CONVERSION);
+	DEBUG_FROM_ENV (GITG_DEBUG_CONFIG);
 }
 
 gboolean
diff --git a/libgitg/gitg-debug.h b/libgitg/gitg-debug.h
index 2dfa575..55d4428 100644
--- a/libgitg/gitg-debug.h
+++ b/libgitg/gitg-debug.h
@@ -31,7 +31,8 @@ enum
 	GITG_DEBUG_NONE = 0,
 	GITG_DEBUG_SHELL = 1 << 0,
 	GITG_DEBUG_SHELL_OUTPUT = 1 << 1,
-	GITG_DEBUG_CHARSET_CONVERSION = 1 << 2
+	GITG_DEBUG_CHARSET_CONVERSION = 1 << 2,
+	GITG_DEBUG_CONFIG = 1 << 3
 };
 
 #if ENABLE_DEBUG



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]