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

@@ -19,6 +19,7 @@
#include "config.h"
#include "DecoderAPI.hxx"
#include "DecoderError.hxx"
#include "AudioConfig.hxx"
#include "replay_gain_config.h"
#include "MusicChunk.hxx"
@@ -29,16 +30,12 @@
#include "Song.hxx"
#include "InputStream.hxx"
#include "util/Error.hxx"
#include <glib.h>
#include "Log.hxx"
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#undef G_LOG_DOMAIN
#define G_LOG_DOMAIN "decoder"
void
decoder_initialized(struct decoder *decoder,
const AudioFormat audio_format,
@@ -67,14 +64,14 @@ decoder_initialized(struct decoder *decoder,
dc->client_cond.signal();
dc->Unlock();
g_debug("audio_format=%s, seekable=%s",
audio_format_to_string(dc->in_audio_format, &af_string),
seekable ? "true" : "false");
FormatDebug(decoder_domain, "audio_format=%s, seekable=%s",
audio_format_to_string(dc->in_audio_format, &af_string),
seekable ? "true" : "false");
if (dc->in_audio_format != dc->out_audio_format)
g_debug("converting to %s",
audio_format_to_string(dc->out_audio_format,
&af_string));
FormatDebug(decoder_domain, "converting to %s",
audio_format_to_string(dc->out_audio_format,
&af_string));
}
/**
@@ -288,7 +285,7 @@ size_t decoder_read(struct decoder *decoder,
assert(nbytes > 0 || error.IsDefined() || is->IsEOF());
if (gcc_unlikely(nbytes == 0 && error.IsDefined()))
g_warning("%s", error.GetMessage());
LogError(error);
is->Unlock();
@@ -404,7 +401,7 @@ decoder_data(struct decoder *decoder,
/* the PCM conversion has failed - stop
playback, since we have no better way to
bail out */
g_warning("%s", error.GetMessage());
LogError(error);
return DecoderCommand::STOP;
}
}