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:
Max Kellermann
2013-09-27 22:31:24 +02:00
parent c53492a76a
commit 060814daa8
162 changed files with 1992 additions and 1280 deletions

View File

@@ -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

View File

@@ -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;

View File

@@ -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;
}

View File

@@ -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;