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/filter/ReplayGainFilterPlugin.cxx | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'src/filter/ReplayGainFilterPlugin.cxx') diff --git a/src/filter/ReplayGainFilterPlugin.cxx b/src/filter/ReplayGainFilterPlugin.cxx index 0dd8905cb..d22a5232e 100644 --- a/src/filter/ReplayGainFilterPlugin.cxx +++ b/src/filter/ReplayGainFilterPlugin.cxx @@ -30,14 +30,12 @@ #include "pcm/PcmBuffer.hxx" #include "util/Error.hxx" #include "util/Domain.hxx" - -#include +#include "Log.hxx" #include #include -#undef G_LOG_DOMAIN -#define G_LOG_DOMAIN "replay_gain" +static constexpr Domain replay_gain_domain("replay_gain"); class ReplayGainFilter final : public Filter { /** @@ -105,7 +103,9 @@ public: /* no change */ return; - g_debug("replay gain mode has changed %d->%d\n", mode, _mode); + FormatDebug(replay_gain_domain, + "replay gain mode has changed %d->%d\n", + mode, _mode); mode = _mode; Update(); @@ -122,15 +122,14 @@ public: size_t *dest_size_r, Error &error); }; -static constexpr Domain replay_gain_domain("replay_gain"); - void ReplayGainFilter::Update() { if (mode != REPLAY_GAIN_OFF) { float scale = replay_gain_tuple_scale(&info.tuples[mode], replay_gain_preamp, replay_gain_missing_preamp, replay_gain_limit); - g_debug("scale=%f\n", (double)scale); + FormatDebug(replay_gain_domain, + "scale=%f\n", (double)scale); volume = pcm_float_to_volume(scale); } else @@ -145,8 +144,7 @@ ReplayGainFilter::Update() Error error; if (!mixer_set_volume(mixer, _volume, error)) - g_warning("Failed to update hardware mixer: %s", - error.GetMessage()); + LogError(error, "Failed to update hardware mixer"); } } -- cgit v1.2.3