From 060814daa83f6a94f5934464ae42a406c5c7e947 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 27 Sep 2013 22:31:24 +0200 Subject: Log: new logging library API Prepare to migrate away from GLib. Currently, we're still using GLib as a backend. --- src/UpdateWalk.cxx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/UpdateWalk.cxx') 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 @@ -49,9 +51,6 @@ #include #include -#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; } -- cgit v1.2.3