diff options
author | Max Kellermann <max@duempel.org> | 2013-09-27 22:31:24 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-10-02 08:57:55 +0200 |
commit | 060814daa83f6a94f5934464ae42a406c5c7e947 (patch) | |
tree | f636ec6cdbb8e52fda6db987d2a28fc73c7b94b4 /src/decoder/ModplugDecoderPlugin.cxx | |
parent | c53492a76a8a05825e1c7f699c05645eee891199 (diff) | |
download | mpd-060814daa83f6a94f5934464ae42a406c5c7e947.tar.gz mpd-060814daa83f6a94f5934464ae42a406c5c7e947.tar.xz mpd-060814daa83f6a94f5934464ae42a406c5c7e947.zip |
Log: new logging library API
Prepare to migrate away from GLib. Currently, we're still using GLib
as a backend.
Diffstat (limited to '')
-rw-r--r-- | src/decoder/ModplugDecoderPlugin.cxx | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/decoder/ModplugDecoderPlugin.cxx b/src/decoder/ModplugDecoderPlugin.cxx index 9cbf44b15..39c366492 100644 --- a/src/decoder/ModplugDecoderPlugin.cxx +++ b/src/decoder/ModplugDecoderPlugin.cxx @@ -22,6 +22,8 @@ #include "DecoderAPI.hxx" #include "InputStream.hxx" #include "tag/TagHandler.hxx" +#include "util/Domain.hxx" +#include "Log.hxx" #include <libmodplug/modplug.h> @@ -29,8 +31,7 @@ #include <assert.h> -#undef G_LOG_DOMAIN -#define G_LOG_DOMAIN "modplug" +static constexpr Domain modplug_domain("modplug"); static constexpr size_t MODPLUG_FRAME_SIZE = 4096; static constexpr size_t MODPLUG_PREALLOC_BLOCK = 256 * 1024; @@ -43,12 +44,12 @@ mod_loadfile(struct decoder *decoder, struct input_stream *is) const goffset size = is->GetSize(); if (size == 0) { - g_warning("file is empty"); + LogWarning(modplug_domain, "file is empty"); return nullptr; } if (size > MODPLUG_FILE_LIMIT) { - g_warning("file too large"); + LogWarning(modplug_domain, "file too large"); return nullptr; } @@ -77,7 +78,7 @@ mod_loadfile(struct decoder *decoder, struct input_stream *is) } if (goffset(bdatas->len + ret) > MODPLUG_FILE_LIMIT) { - g_warning("stream too large\n"); + LogWarning(modplug_domain, "stream too large"); g_free(data); g_byte_array_free(bdatas, TRUE); return nullptr; @@ -103,7 +104,7 @@ mod_decode(struct decoder *decoder, struct input_stream *is) bdatas = mod_loadfile(decoder, is); if (!bdatas) { - g_warning("could not load stream\n"); + LogWarning(modplug_domain, "could not load stream"); return; } @@ -119,7 +120,7 @@ mod_decode(struct decoder *decoder, struct input_stream *is) f = ModPlug_Load(bdatas->data, bdatas->len); g_byte_array_free(bdatas, TRUE); if (!f) { - g_warning("could not decode stream\n"); + LogWarning(modplug_domain, "could not decode stream"); return; } |