[virt-tools-list] [PATCH virt-viewer] Silence a message about missing configuration file
Christophe Fergeau
cfergeau at redhat.com
Wed Mar 12 14:06:40 UTC 2014
ACK
On Wed, Mar 12, 2014 at 02:58:18PM +0100, Marc-André Lureau wrote:
> 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
>
> _______________________________________________
> virt-tools-list mailing list
> virt-tools-list at redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/virt-tools-list/attachments/20140312/50b6031c/attachment.sig>
More information about the virt-tools-list
mailing list