aboutsummaryrefslogtreecommitdiffstats
path: root/src/ArchiveLookup.cxx
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/ArchiveLookup.cxx
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/ArchiveLookup.cxx')
-rw-r--r--src/ArchiveLookup.cxx15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/ArchiveLookup.cxx b/src/ArchiveLookup.cxx
index 747f5c7e5..c781fcdaf 100644
--- a/src/ArchiveLookup.cxx
+++ b/src/ArchiveLookup.cxx
@@ -19,15 +19,17 @@
#include "config.h" /* must be first for large file support */
#include "ArchiveLookup.hxx"
+#include "util/Domain.hxx"
+#include "Log.hxx"
-#include <stdio.h>
+#include <glib.h>
#include <string.h>
-#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <errno.h>
-#include <glib.h>
+
+static constexpr Domain archive_domain("archive");
/**
*
@@ -65,7 +67,8 @@ bool archive_lookup(char *pathname, char **archive, char **inpath, char **suffix
//try to stat if its real directory
if (stat(pathdupe, &st_info) == -1) {
if (errno != ENOTDIR) {
- g_warning("stat %s failed (errno=%d)\n", pathdupe, errno);
+ FormatErrno(archive_domain,
+ "Failed to stat %s", pathdupe);
break;
}
} else {
@@ -92,7 +95,9 @@ bool archive_lookup(char *pathname, char **archive, char **inpath, char **suffix
}
break;
} else {
- g_warning("not a regular file %s\n", pathdupe);
+ FormatError(archive_domain,
+ "Not a regular file: %s",
+ pathdupe);
break;
}
}