aboutsummaryrefslogtreecommitdiffstats
path: root/src/UpdateSong.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/UpdateSong.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/UpdateSong.cxx')
-rw-r--r--src/UpdateSong.cxx30
1 files changed, 17 insertions, 13 deletions
diff --git a/src/UpdateSong.cxx b/src/UpdateSong.cxx
index b1f8cac4d..3aef2b560 100644
--- a/src/UpdateSong.cxx
+++ b/src/UpdateSong.cxx
@@ -23,13 +23,13 @@
#include "UpdateIO.hxx"
#include "UpdateDatabase.hxx"
#include "UpdateContainer.hxx"
+#include "UpdateDomain.hxx"
#include "DatabaseLock.hxx"
#include "Directory.hxx"
#include "Song.hxx"
#include "DecoderPlugin.hxx"
#include "DecoderList.hxx"
-
-#include <glib.h>
+#include "Log.hxx"
#include <unistd.h>
@@ -43,8 +43,9 @@ update_song_file2(Directory *directory,
db_unlock();
if (!directory_child_access(directory, name, R_OK)) {
- g_warning("no read permissions on %s/%s",
- directory->GetPath(), name);
+ FormatError(update_domain,
+ "no read permissions on %s/%s",
+ directory->GetPath(), name);
if (song != NULL) {
db_lock();
delete_song(directory, song);
@@ -67,11 +68,13 @@ update_song_file2(Directory *directory,
}
if (song == NULL) {
- g_debug("reading %s/%s", directory->GetPath(), name);
+ FormatDebug(update_domain, "reading %s/%s",
+ directory->GetPath(), name);
song = Song::LoadFile(name, directory);
if (song == NULL) {
- g_debug("ignoring unrecognized file %s/%s",
- directory->GetPath(), name);
+ FormatDebug(update_domain,
+ "ignoring unrecognized file %s/%s",
+ directory->GetPath(), name);
return;
}
@@ -80,14 +83,15 @@ update_song_file2(Directory *directory,
db_unlock();
modified = true;
- g_message("added %s/%s",
- directory->GetPath(), name);
+ FormatInfo(update_domain, "added %s/%s",
+ directory->GetPath(), name);
} else if (st->st_mtime != song->mtime || walk_discard) {
- g_message("updating %s/%s",
- directory->GetPath(), name);
+ FormatInfo(update_domain, "updating %s/%s",
+ directory->GetPath(), name);
if (!song->UpdateFile()) {
- g_debug("deleting unrecognized file %s/%s",
- directory->GetPath(), name);
+ FormatDebug(update_domain,
+ "deleting unrecognized file %s/%s",
+ directory->GetPath(), name);
db_lock();
delete_song(directory, song);
db_unlock();