From 060814daa83f6a94f5934464ae42a406c5c7e947 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 27 Sep 2013 22:31:24 +0200 Subject: Log: new logging library API Prepare to migrate away from GLib. Currently, we're still using GLib as a backend. --- src/playlist/XspfPlaylistPlugin.cxx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/playlist/XspfPlaylistPlugin.cxx') diff --git a/src/playlist/XspfPlaylistPlugin.cxx b/src/playlist/XspfPlaylistPlugin.cxx index 797fd7f3a..9b55f1962 100644 --- a/src/playlist/XspfPlaylistPlugin.cxx +++ b/src/playlist/XspfPlaylistPlugin.cxx @@ -24,14 +24,15 @@ #include "InputStream.hxx" #include "tag/Tag.hxx" #include "util/Error.hxx" +#include "util/Domain.hxx" +#include "Log.hxx" #include #include #include -#undef G_LOG_DOMAIN -#define G_LOG_DOMAIN "xspf" +static constexpr Domain xspf_domain("xspf"); /** * This is the state object for the GLib XML parser. @@ -240,7 +241,7 @@ xspf_open_stream(struct input_stream *is) if (nbytes == 0) { if (error2.IsDefined()) { g_markup_parse_context_free(context); - g_warning("%s", error2.GetMessage()); + LogError(error2); return NULL; } @@ -250,7 +251,8 @@ xspf_open_stream(struct input_stream *is) success = g_markup_parse_context_parse(context, buffer, nbytes, &error); if (!success) { - g_warning("XML parser failed: %s", error->message); + FormatError(xspf_domain, + "XML parser failed: %s", error->message); g_error_free(error); g_markup_parse_context_free(context); return NULL; @@ -259,7 +261,8 @@ xspf_open_stream(struct input_stream *is) success = g_markup_parse_context_end_parse(context, &error); if (!success) { - g_warning("XML parser failed: %s", error->message); + FormatError(xspf_domain, + "XML parser failed: %s", error->message); g_error_free(error); g_markup_parse_context_free(context); return NULL; -- cgit v1.2.3