[gnome-keyring] Quiet down messages during tests



commit e4f2dd1a5e37884c3eb1c93322c1b71b70daedac
Author: Stef Walter <stefw gnome org>
Date:   Wed Jun 27 11:27:36 2012 +0200

    Quiet down messages during tests
    
     * Several of these are common messages, so move them to debug
       logs.

 daemon/gkd-capability.c               |    3 ++-
 pkcs11/gkm/gkm-certificate.c          |    6 ++++--
 pkcs11/roots-store/gkm-roots-module.c |    4 +++-
 pkcs11/xdg-store/gkm-xdg-module.c     |    4 +++-
 4 files changed, 12 insertions(+), 5 deletions(-)
---
diff --git a/daemon/gkd-capability.c b/daemon/gkd-capability.c
index 92c000c..f746fe6 100644
--- a/daemon/gkd-capability.c
+++ b/daemon/gkd-capability.c
@@ -45,7 +45,8 @@ early_error (const char *err_string)
 static void
 early_warning (const char *warn_string)
 {
-	fprintf (stderr, "gnome-keyring-daemon: %s\n", warn_string);
+	if (!getenv ("GNOME_KEYRING_TEST_SERVICE"))
+		fprintf (stderr, "gnome-keyring-daemon: %s\n", warn_string);
 }
 
 #endif /* HAVE_LIPCAPNG */
diff --git a/pkcs11/gkm/gkm-certificate.c b/pkcs11/gkm/gkm-certificate.c
index 580cba2..5efe036 100644
--- a/pkcs11/gkm/gkm-certificate.c
+++ b/pkcs11/gkm/gkm-certificate.c
@@ -27,6 +27,8 @@
 #include "gkm-crypto.h"
 #include "gkm-data-asn1.h"
 #include "gkm-data-der.h"
+#define DEBUG_FLAG GKM_DEBUG_STORAGE
+#include "gkm-debug.h"
 #include "gkm-factory.h"
 #include "gkm-sexp-key.h"
 #include "gkm-manager.h"
@@ -386,14 +388,14 @@ gkm_certificate_real_load (GkmSerializable *base,
 	GkmSexp *wrapper;
 
 	if (egg_bytes_get_size (data) == 0) {
-		g_message ("cannot load empty certificate file");
+		gkm_debug ("cannot load empty certificate file");
 		return FALSE;
 	}
 
 	/* Parse the ASN1 data */
 	res = gkm_data_der_read_certificate (data, &asn1);
 	if (res != GKM_DATA_SUCCESS) {
-		g_message ("couldn't parse certificate data");
+		gkm_debug ("couldn't parse certificate data");
 		return FALSE;
 	}
 
diff --git a/pkcs11/roots-store/gkm-roots-module.c b/pkcs11/roots-store/gkm-roots-module.c
index 253b801..3ad4524 100644
--- a/pkcs11/roots-store/gkm-roots-module.c
+++ b/pkcs11/roots-store/gkm-roots-module.c
@@ -25,6 +25,8 @@
 #include "gkm-roots-module.h"
 #include "gkm-roots-certificate.h"
 
+#define DEBUG_FLAG GKM_DEBUG_STORAGE
+#include "gkm/gkm-debug.h"
 #include "gkm/gkm-file-tracker.h"
 #include "gkm/gkm-serializable.h"
 
@@ -127,7 +129,7 @@ add_certificate_for_data (GkmRootsModule *self,
 	g_free (unique);
 
 	if (!gkm_serializable_load (GKM_SERIALIZABLE (cert), NULL, data)) {
-		g_message ("couldn't parse certificate(s): %s", path);
+		gkm_debug ("couldn't parse certificate(s): %s", path);
 		g_object_unref (cert);
 		return NULL;
 	}
diff --git a/pkcs11/xdg-store/gkm-xdg-module.c b/pkcs11/xdg-store/gkm-xdg-module.c
index fd3da09..669a4bd 100644
--- a/pkcs11/xdg-store/gkm-xdg-module.c
+++ b/pkcs11/xdg-store/gkm-xdg-module.c
@@ -34,6 +34,8 @@
 
 #include "gkm/gkm-assertion.h"
 #include "gkm/gkm-certificate.h"
+#define DEBUG_FLAG GKM_DEBUG_STORAGE
+#include "gkm/gkm-debug.h"
 #include "gkm/gkm-file-tracker.h"
 #include "gkm/gkm-serializable.h"
 #include "gkm/gkm-transaction.h"
@@ -220,7 +222,7 @@ file_load (GkmFileTracker *tracker, const gchar *path, GkmXdgModule *self)
 		/* Figure out what type of object we're dealing with */
 		type = type_from_path (path);
 		if (type == 0) {
-			g_message ("don't know how to load file in key store: %s", path);
+			gkm_debug ("don't know how to load file in key store: %s", path);
 			return;
 		}
 



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