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/mixer/AlsaMixerPlugin.cxx | 6 ++++-- src/mixer/OssMixerPlugin.cxx | 6 ++++-- src/mixer/PulseMixerPlugin.cxx | 14 +++++++------- src/mixer/WinmmMixerPlugin.cxx | 3 --- 4 files changed, 15 insertions(+), 14 deletions(-) (limited to 'src/mixer') diff --git a/src/mixer/AlsaMixerPlugin.cxx b/src/mixer/AlsaMixerPlugin.cxx index 13e3283f0..05d70c4c0 100644 --- a/src/mixer/AlsaMixerPlugin.cxx +++ b/src/mixer/AlsaMixerPlugin.cxx @@ -27,6 +27,7 @@ #include "util/ReusableArray.hxx" #include "util/Error.hxx" #include "util/Domain.hxx" +#include "Log.hxx" #include @@ -124,8 +125,9 @@ AlsaMixerMonitor::DispatchSockets() int err = snd_mixer_handle_events(mixer); if (err < 0) { - g_warning("snd_mixer_handle_events() failed: %s", - snd_strerror(err)); + FormatError(alsa_mixer_domain, + "snd_mixer_handle_events() failed: %s", + snd_strerror(err)); if (err == -ENODEV) { /* the sound device was unplugged; disable diff --git a/src/mixer/OssMixerPlugin.cxx b/src/mixer/OssMixerPlugin.cxx index 84cd223e6..5b533470b 100644 --- a/src/mixer/OssMixerPlugin.cxx +++ b/src/mixer/OssMixerPlugin.cxx @@ -23,6 +23,7 @@ #include "system/fd_util.h" #include "util/Error.hxx" #include "util/Domain.hxx" +#include "Log.hxx" #include @@ -190,8 +191,9 @@ OssMixer::GetVolume(Error &error) right = (level & 0xff00) >> 8; if (left != right) { - g_warning("volume for left and right is not the same, \"%i\" and " - "\"%i\"\n", left, right); + FormatWarning(oss_mixer_domain, + "volume for left and right is not the same, \"%i\" and " + "\"%i\"\n", left, right); } return left; diff --git a/src/mixer/PulseMixerPlugin.cxx b/src/mixer/PulseMixerPlugin.cxx index 2a5b48f3d..f651c34b0 100644 --- a/src/mixer/PulseMixerPlugin.cxx +++ b/src/mixer/PulseMixerPlugin.cxx @@ -24,6 +24,7 @@ #include "GlobalEvents.hxx" #include "util/Error.hxx" #include "util/Domain.hxx" +#include "Log.hxx" #include @@ -37,9 +38,6 @@ #include #include -#undef G_LOG_DOMAIN -#define G_LOG_DOMAIN "pulse_mixer" - struct PulseMixer final : public Mixer { PulseOutput *output; @@ -104,8 +102,9 @@ pulse_mixer_update(PulseMixer *pm, pa_stream_get_index(stream), pulse_mixer_volume_cb, pm); if (o == NULL) { - g_warning("pa_context_get_sink_input_info() failed: %s", - pa_strerror(pa_context_errno(context))); + FormatError(pulse_mixer_domain, + "pa_context_get_sink_input_info() failed: %s", + pa_strerror(pa_context_errno(context))); pulse_mixer_offline(pm); return; } @@ -125,8 +124,9 @@ pulse_mixer_on_connect(gcc_unused PulseMixer *pm, (pa_subscription_mask_t)PA_SUBSCRIPTION_MASK_SINK_INPUT, NULL, NULL); if (o == NULL) { - g_warning("pa_context_subscribe() failed: %s", - pa_strerror(pa_context_errno(context))); + FormatError(pulse_mixer_domain, + "pa_context_subscribe() failed: %s", + pa_strerror(pa_context_errno(context))); return; } diff --git a/src/mixer/WinmmMixerPlugin.cxx b/src/mixer/WinmmMixerPlugin.cxx index ae25b532c..dbb43dce4 100644 --- a/src/mixer/WinmmMixerPlugin.cxx +++ b/src/mixer/WinmmMixerPlugin.cxx @@ -30,9 +30,6 @@ #include #include -#undef G_LOG_DOMAIN -#define G_LOG_DOMAIN "winmm_mixer" - struct WinmmMixer final : public Mixer { WinmmOutput *output; -- cgit v1.2.3