Log: new logging library API
Prepare to migrate away from GLib. Currently, we're still using GLib as a backend.
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
#include "util/ReusableArray.hxx"
|
||||
#include "util/Error.hxx"
|
||||
#include "util/Domain.hxx"
|
||||
#include "Log.hxx"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
@@ -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
|
||||
|
@@ -23,6 +23,7 @@
|
||||
#include "system/fd_util.h"
|
||||
#include "util/Error.hxx"
|
||||
#include "util/Domain.hxx"
|
||||
#include "Log.hxx"
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
@@ -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;
|
||||
|
@@ -24,6 +24,7 @@
|
||||
#include "GlobalEvents.hxx"
|
||||
#include "util/Error.hxx"
|
||||
#include "util/Domain.hxx"
|
||||
#include "Log.hxx"
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
@@ -37,9 +38,6 @@
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#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;
|
||||
}
|
||||
|
||||
|
@@ -30,9 +30,6 @@
|
||||
#include <math.h>
|
||||
#include <windows.h>
|
||||
|
||||
#undef G_LOG_DOMAIN
|
||||
#define G_LOG_DOMAIN "winmm_mixer"
|
||||
|
||||
struct WinmmMixer final : public Mixer {
|
||||
WinmmOutput *output;
|
||||
|
||||
|
Reference in New Issue
Block a user