From 64e6836ac8fb96f38a859eea0d8525cd9bd2693f Mon Sep 17 00:00:00 2001 From: Anusha Rao Date: Mon, 4 May 2015 12:34:09 +0530 Subject: features/changelog: Porting log messages to new logging framework Change-Id: Ic7f842acca52908fd88e0796dc90b82650405b25 BUG: 1194640 Signed-off-by: Anusha Rao Reviewed-on: http://review.gluster.org/10532 Tested-by: NetBSD Build System Tested-by: Gluster Build System Reviewed-by: Venky Shankar Reviewed-by: Kotresh HR --- xlators/features/changelog/lib/src/gf-changelog-api.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'xlators/features/changelog/lib/src/gf-changelog-api.c') diff --git a/xlators/features/changelog/lib/src/gf-changelog-api.c b/xlators/features/changelog/lib/src/gf-changelog-api.c index eee3ad1eefd..63c0098d248 100644 --- a/xlators/features/changelog/lib/src/gf-changelog-api.c +++ b/xlators/features/changelog/lib/src/gf-changelog-api.c @@ -15,6 +15,7 @@ #include "gf-changelog-helpers.h" #include "gf-changelog-journal.h" #include "changelog-mem-types.h" +#include "changelog-lib-messages.h" int gf_changelog_done (char *file) @@ -49,13 +50,14 @@ gf_changelog_done (char *file) (void) snprintf (to_path, PATH_MAX, "%s%s", jnl->jnl_processed_dir, basename (buffer)); - gf_log (this->name, GF_LOG_DEBUG, - "moving %s to processed directory", file); + gf_msg_debug (this->name, 0, + "moving %s to processed directory", file); ret = rename (buffer, to_path); if (ret) { - gf_log (this->name, GF_LOG_ERROR, - "cannot move %s to %s (reason: %s)", - file, to_path, strerror (errno)); + gf_msg (this->name, GF_LOG_ERROR, errno, + CHANGELOG_LIB_MSG_RENAME_FAILED, + "cannot move %s to %s", + file, to_path); goto out; } @@ -205,7 +207,8 @@ gf_changelog_scan () GF_CHANGELOG_FILL_BUFFER ("\n", buffer, off, 1); if (gf_changelog_write (tracker_fd, buffer, off) != off) { - gf_log (this->name, GF_LOG_ERROR, + gf_msg (this->name, GF_LOG_ERROR, 0, + CHANGELOG_LIB_MSG_WRITE_FAILED, "error writing changelog filename" " to tracker file"); break; -- cgit