aboutsummaryrefslogtreecommitdiffstats
path: root/src/UpdateGlue.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/UpdateGlue.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/UpdateGlue.cxx')
-rw-r--r--src/UpdateGlue.cxx21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/UpdateGlue.cxx b/src/UpdateGlue.cxx
index 972842bb1..a4a47d468 100644
--- a/src/UpdateGlue.cxx
+++ b/src/UpdateGlue.cxx
@@ -22,11 +22,13 @@
#include "UpdateQueue.hxx"
#include "UpdateWalk.hxx"
#include "UpdateRemove.hxx"
+#include "UpdateDomain.hxx"
#include "Mapper.hxx"
#include "DatabaseSimple.hxx"
#include "Idle.hxx"
#include "GlobalEvents.hxx"
#include "util/Error.hxx"
+#include "Log.hxx"
extern "C" {
#include "stats.h"
@@ -40,9 +42,6 @@ extern "C" {
#include <assert.h>
-#undef G_LOG_DOMAIN
-#define G_LOG_DOMAIN "update"
-
static enum update_progress {
UPDATE_PROGRESS_IDLE = 0,
UPDATE_PROGRESS_RUNNING = 1,
@@ -71,23 +70,22 @@ static void * update_task(void *_path)
const char *path = (const char *)_path;
if (path != NULL && *path != 0)
- g_debug("starting: %s", path);
+ FormatDebug(update_domain, "starting: %s", path);
else
- g_debug("starting");
+ LogDebug(update_domain, "starting");
modified = update_walk(path, discard);
if (modified || !db_exists()) {
Error error;
if (!db_save(error))
- g_warning("Failed to save database: %s",
- error.GetMessage());
+ LogError(error, "Failed to save database");
}
if (path != NULL && *path != 0)
- g_debug("finished: %s", path);
+ FormatDebug(update_domain, "finished: %s", path);
else
- g_debug("finished");
+ LogDebug(update_domain, "finished");
g_free(_path);
progress = UPDATE_PROGRESS_DONE;
@@ -104,7 +102,7 @@ spawn_update_task(const char *path)
modified = false;
#if GLIB_CHECK_VERSION(2,32,0)
- update_thr = g_thread_new("updadte", update_task, g_strdup(path));
+ update_thr = g_thread_new("update", update_task, g_strdup(path));
#else
GError *e = NULL;
update_thr = g_thread_create(update_task, g_strdup(path), TRUE, &e);
@@ -114,7 +112,8 @@ spawn_update_task(const char *path)
if (++update_task_id > update_task_id_max)
update_task_id = 1;
- g_debug("spawned thread for update job id %i", update_task_id);
+ FormatDebug(update_domain,
+ "spawned thread for update job id %i", update_task_id);
}
unsigned