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/DecoderThread.cxx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/DecoderThread.cxx') diff --git a/src/DecoderThread.cxx b/src/DecoderThread.cxx index 2c07689df..1aa60ce3f 100644 --- a/src/DecoderThread.cxx +++ b/src/DecoderThread.cxx @@ -33,15 +33,16 @@ #include "DecoderList.hxx" #include "util/UriUtil.hxx" #include "util/Error.hxx" +#include "util/Domain.hxx" #include "tag/ApeReplayGain.hxx" +#include "Log.hxx" #include #include #include /* for SEEK_SET */ -#undef G_LOG_DOMAIN -#define G_LOG_DOMAIN "decoder_thread" +static constexpr Domain decoder_thread_domain("decoder_thread"); /** * Marks the current decoder command as "finished" and notifies the @@ -78,7 +79,7 @@ decoder_input_stream_open(struct decoder_control *dc, const char *uri) input_stream *is = input_stream::Open(uri, dc->mutex, dc->cond, error); if (is == NULL) { if (error.IsDefined()) - g_warning("%s", error.GetMessage()); + LogError(error); return NULL; } @@ -99,7 +100,7 @@ decoder_input_stream_open(struct decoder_control *dc, const char *uri) if (!is->Check(error)) { dc->Unlock(); - g_warning("%s", error.GetMessage()); + LogError(error); return NULL; } @@ -122,7 +123,7 @@ decoder_stream_decode(const struct decoder_plugin *plugin, assert(input_stream->ready); assert(decoder->dc->state == DecoderState::START); - g_debug("probing plugin %s", plugin->name); + FormatDebug(decoder_thread_domain, "probing plugin %s", plugin->name); if (decoder->dc->command == DecoderCommand::STOP) return true; @@ -155,7 +156,7 @@ decoder_file_decode(const struct decoder_plugin *plugin, assert(g_path_is_absolute(path)); assert(decoder->dc->state == DecoderState::START); - g_debug("probing plugin %s", plugin->name); + FormatDebug(decoder_thread_domain, "probing plugin %s", plugin->name); if (decoder->dc->command == DecoderCommand::STOP) return true; -- cgit v1.2.3