aboutsummaryrefslogtreecommitdiffstats
path: root/src/UpdateWalk.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/UpdateWalk.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/UpdateWalk.cxx')
-rw-r--r--src/UpdateWalk.cxx15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/UpdateWalk.cxx b/src/UpdateWalk.cxx
index bd104c564..cfa68dcf4 100644
--- a/src/UpdateWalk.cxx
+++ b/src/UpdateWalk.cxx
@@ -23,6 +23,7 @@
#include "UpdateDatabase.hxx"
#include "UpdateSong.hxx"
#include "UpdateArchive.hxx"
+#include "UpdateDomain.hxx"
#include "DatabaseLock.hxx"
#include "DatabaseSimple.hxx"
#include "Directory.hxx"
@@ -37,6 +38,7 @@
#include "fs/FileSystem.hxx"
#include "fs/DirectoryReader.hxx"
#include "util/UriUtil.hxx"
+#include "Log.hxx"
#include <glib.h>
@@ -49,9 +51,6 @@
#include <stdlib.h>
#include <errno.h>
-#undef G_LOG_DOMAIN
-#define G_LOG_DOMAIN "update"
-
bool walk_discard;
bool modified;
@@ -185,7 +184,7 @@ find_inode_ancestor(Directory *parent, ino_t inode, dev_t device)
return -1;
if (parent->inode == inode && parent->device == device) {
- g_debug("recursive directory found");
+ LogDebug(update_domain, "recursive directory found");
return 1;
}
@@ -257,7 +256,8 @@ update_directory_child(Directory *directory,
db_unlock();
}
} else {
- g_debug("update: %s is not a directory, archive or music", name);
+ FormatDebug(update_domain,
+ "%s is not a directory, archive or music", name);
}
}
@@ -352,8 +352,9 @@ update_directory(Directory *directory, const struct stat *st)
if (reader.HasFailed()) {
int error = errno;
const auto path_utf8 = path_fs.ToUTF8();
- g_warning("Failed to open directory %s: %s",
- path_utf8.c_str(), g_strerror(error));
+ FormatErrno(update_domain, error,
+ "Failed to open directory %s",
+ path_utf8.c_str());
return false;
}