[virt-tools-list] [PATCH virt-viewer] Silence a message about missing configuration file
Marc-André Lureau
marcandre.lureau at gmail.com
Wed Mar 12 13:58:18 UTC 2014
Do not print a g_debug() error when the configuration file is missing,
unless given the --debug option.
https://bugzilla.redhat.com/show_bug.cgi?id=1006737
---
src/virt-viewer-app.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
index e134894..f820d8c 100644
--- a/src/virt-viewer-app.c
+++ b/src/virt-viewer-app.c
@@ -1601,8 +1601,11 @@ virt_viewer_app_init (VirtViewerApp *self)
g_key_file_load_from_file(self->priv->config, self->priv->config_file,
G_KEY_FILE_KEEP_COMMENTS|G_KEY_FILE_KEEP_TRANSLATIONS, &error);
- if (error)
- g_debug("Couldn't load configuration: %s", error->message);
+
+ if (g_error_matches(error, G_FILE_ERROR, G_FILE_ERROR_NOENT))
+ DEBUG_LOG("No configuration file %s", self->priv->config_file);
+ else if (error)
+ g_warning("Couldn't load configuration: %s", error->message);
g_clear_error(&error);
--
1.8.5.3
More information about the virt-tools-list
mailing list