aboutsummaryrefslogtreecommitdiffstats
path: root/src/input
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-09-27 22:31:24 +0200
committerMax Kellermann <max@duempel.org>2013-10-02 08:57:55 +0200
commit060814daa83f6a94f5934464ae42a406c5c7e947 (patch)
treef636ec6cdbb8e52fda6db987d2a28fc73c7b94b4 /src/input
parentc53492a76a8a05825e1c7f699c05645eee891199 (diff)
downloadmpd-060814daa83f6a94f5934464ae42a406c5c7e947.tar.gz
mpd-060814daa83f6a94f5934464ae42a406c5c7e947.tar.xz
mpd-060814daa83f6a94f5934464ae42a406c5c7e947.zip
Log: new logging library API
Prepare to migrate away from GLib. Currently, we're still using GLib as a backend.
Diffstat (limited to 'src/input')
-rw-r--r--src/input/ArchiveInputPlugin.cxx10
-rw-r--r--src/input/CdioParanoiaInputPlugin.cxx13
-rw-r--r--src/input/CurlInputPlugin.cxx16
-rw-r--r--src/input/DespotifyInputPlugin.cxx9
-rw-r--r--src/input/FfmpegInputPlugin.cxx3
-rw-r--r--src/input/FileInputPlugin.cxx3
-rw-r--r--src/input/MmsInputPlugin.cxx3
-rw-r--r--src/input/RewindInputPlugin.cxx3
8 files changed, 30 insertions, 30 deletions
diff --git a/src/input/ArchiveInputPlugin.cxx b/src/input/ArchiveInputPlugin.cxx
index 025b25fef..08e1cabfe 100644
--- a/src/input/ArchiveInputPlugin.cxx
+++ b/src/input/ArchiveInputPlugin.cxx
@@ -25,9 +25,13 @@
#include "ArchiveFile.hxx"
#include "InputPlugin.hxx"
#include "util/Error.hxx"
+#include "util/Domain.hxx"
+#include "Log.hxx"
#include <glib.h>
+static constexpr Domain archive_domain("archive");
+
/**
* select correct archive plugin to handle the input stream
* may allow stacking of archive plugins. for example for handling
@@ -51,7 +55,8 @@ input_archive_open(const char *pathname,
pname = g_strdup(pathname);
// archive_lookup will modify pname when true is returned
if (!archive_lookup(pname, &archive, &filename, &suffix)) {
- g_debug("not an archive, lookup %s failed\n", pname);
+ FormatDebug(archive_domain,
+ "not an archive, lookup %s failed", pname);
g_free(pname);
return NULL;
}
@@ -59,7 +64,8 @@ input_archive_open(const char *pathname,
//check which archive plugin to use (by ext)
arplug = archive_plugin_from_suffix(suffix);
if (!arplug) {
- g_warning("can't handle archive %s\n",archive);
+ FormatWarning(archive_domain,
+ "can't handle archive %s", archive);
g_free(pname);
return NULL;
}
diff --git a/src/input/CdioParanoiaInputPlugin.cxx b/src/input/CdioParanoiaInputPlugin.cxx
index 660c157e8..65db12760 100644
--- a/src/input/CdioParanoiaInputPlugin.cxx
+++ b/src/input/CdioParanoiaInputPlugin.cxx
@@ -28,6 +28,7 @@
#include "InputPlugin.hxx"
#include "util/Error.hxx"
#include "util/Domain.hxx"
+#include "Log.hxx"
#include <stdio.h>
#include <stdint.h>
@@ -195,17 +196,20 @@ input_cdio_open(const char *uri,
bool reverse_endian;
switch (data_bigendianp(i->drv)) {
case -1:
- g_debug("cdda: drive returns unknown audio data");
+ LogDebug(cdio_domain, "drive returns unknown audio data");
reverse_endian = false;
break;
+
case 0:
- g_debug("cdda: drive returns audio data Little Endian.");
+ LogDebug(cdio_domain, "drive returns audio data Little Endian");
reverse_endian = G_BYTE_ORDER == G_BIG_ENDIAN;
break;
+
case 1:
- g_debug("cdda: drive returns audio data Big Endian.");
+ LogDebug(cdio_domain, "drive returns audio data Big Endian");
reverse_endian = G_BYTE_ORDER == G_LITTLE_ENDIAN;
break;
+
default:
error.Format(cdio_domain, "Drive returns unknown data type %d",
data_bigendianp(i->drv));
@@ -305,7 +309,8 @@ input_cdio_read(struct input_stream *is, void *ptr, size_t length,
s_err = cdda_errors(cis->drv);
if (s_err) {
- g_warning("paranoia_read: %s", s_err );
+ FormatError(cdio_domain,
+ "paranoia_read: %s", s_err);
free(s_err);
}
s_mess = cdda_messages(cis->drv);
diff --git a/src/input/CurlInputPlugin.cxx b/src/input/CurlInputPlugin.cxx
index 2c99f5c38..b707da2f0 100644
--- a/src/input/CurlInputPlugin.cxx
+++ b/src/input/CurlInputPlugin.cxx
@@ -31,6 +31,7 @@
#include "IOThread.hxx"
#include "util/Error.hxx"
#include "util/Domain.hxx"
+#include "Log.hxx"
#include <assert.h>
@@ -53,9 +54,6 @@
#error libcurl is too old
#endif
-#undef G_LOG_DOMAIN
-#define G_LOG_DOMAIN "input_curl"
-
/**
* Do not buffer more than this number of bytes. It should be a
* reasonable limit that doesn't make low-end machines suffer too
@@ -297,8 +295,9 @@ CurlSockets::UpdateSockets()
CURLMcode mcode = curl_multi_fdset(curl.multi, &rfds, &wfds,
&efds, &max_fd);
if (mcode != CURLM_OK) {
- g_warning("curl_multi_fdset() failed: %s\n",
- curl_multi_strerror(mcode));
+ FormatError(curlm_domain,
+ "curl_multi_fdset() failed: %s",
+ curl_multi_strerror(mcode));
return;
}
@@ -537,8 +536,9 @@ CurlSockets::PrepareSockets()
return timeout2;
} else {
- g_warning("curl_multi_timeout() failed: %s\n",
- curl_multi_strerror(mcode));
+ FormatWarning(curlm_domain,
+ "curl_multi_timeout() failed: %s",
+ curl_multi_strerror(mcode));
return -1;
}
}
@@ -880,7 +880,7 @@ input_curl_headerfunction(void *ptr, size_t size, size_t nmemb, void *stream)
buffer[end - value] = 0;
icy_metaint = g_ascii_strtoull(buffer, NULL, 10);
- g_debug("icy-metaint=%zu", icy_metaint);
+ FormatDebug(curl_domain, "icy-metaint=%zu", icy_metaint);
if (icy_metaint > 0) {
c->icy.Start(icy_metaint);
diff --git a/src/input/DespotifyInputPlugin.cxx b/src/input/DespotifyInputPlugin.cxx
index 4e441da3c..b0665e659 100644
--- a/src/input/DespotifyInputPlugin.cxx
+++ b/src/input/DespotifyInputPlugin.cxx
@@ -24,6 +24,7 @@
#include "InputStream.hxx"
#include "InputPlugin.hxx"
#include "tag/Tag.hxx"
+#include "Log.hxx"
extern "C" {
#include <despotify.h>
@@ -85,7 +86,7 @@ refill_buffer(DespotifyInputStream *ctx)
break;
if (rc < 0) {
- g_debug("despotify_get_pcm error\n");
+ LogDebug(despotify_domain, "despotify_get_pcm error");
ctx->eof = true;
break;
}
@@ -108,14 +109,14 @@ static void callback(gcc_unused struct despotify_session* ds,
break;
case DESPOTIFY_TRACK_PLAY_ERROR:
- g_debug("Track play error\n");
+ LogWarning(despotify_domain, "Track play error");
ctx->eof = true;
ctx->len_available = 0;
break;
case DESPOTIFY_END_OF_PLAYLIST:
ctx->eof = true;
- g_debug("End of playlist: %d\n", ctx->eof);
+ FormatDebug(despotify_domain, "End of playlist: %d", ctx->eof);
break;
}
}
@@ -139,7 +140,7 @@ input_despotify_open(const char *url,
ds_link = despotify_link_from_uri(url + 6);
if (!ds_link) {
- g_debug("Can't find %s\n", url);
+ FormatDebug(despotify_domain, "Can't find %s", url);
return NULL;
}
if (ds_link->type != LINK_TYPE_TRACK) {
diff --git a/src/input/FfmpegInputPlugin.cxx b/src/input/FfmpegInputPlugin.cxx
index 1837303bb..f8b948c43 100644
--- a/src/input/FfmpegInputPlugin.cxx
+++ b/src/input/FfmpegInputPlugin.cxx
@@ -34,9 +34,6 @@ extern "C" {
#include <libavformat/avformat.h>
}
-#undef G_LOG_DOMAIN
-#define G_LOG_DOMAIN "input_ffmpeg"
-
struct FfmpegInputStream {
struct input_stream base;
diff --git a/src/input/FileInputPlugin.cxx b/src/input/FileInputPlugin.cxx
index 7d1fc0a7f..75103f711 100644
--- a/src/input/FileInputPlugin.cxx
+++ b/src/input/FileInputPlugin.cxx
@@ -33,9 +33,6 @@
#include <string.h>
#include <glib.h>
-#undef G_LOG_DOMAIN
-#define G_LOG_DOMAIN "input_file"
-
static constexpr Domain file_domain("file");
struct FileInputStream {
diff --git a/src/input/MmsInputPlugin.cxx b/src/input/MmsInputPlugin.cxx
index 02810bb22..15c6ac377 100644
--- a/src/input/MmsInputPlugin.cxx
+++ b/src/input/MmsInputPlugin.cxx
@@ -31,9 +31,6 @@
#include <string.h>
#include <errno.h>
-#undef G_LOG_DOMAIN
-#define G_LOG_DOMAIN "input_mms"
-
struct MmsInputStream {
struct input_stream base;
diff --git a/src/input/RewindInputPlugin.cxx b/src/input/RewindInputPlugin.cxx
index 4bf5421db..a49cf7663 100644
--- a/src/input/RewindInputPlugin.cxx
+++ b/src/input/RewindInputPlugin.cxx
@@ -28,9 +28,6 @@
#include <string.h>
#include <stdio.h>
-#undef G_LOG_DOMAIN
-#define G_LOG_DOMAIN "input_rewind"
-
extern const struct input_plugin rewind_input_plugin;
struct RewindInputStream {