summaryrefslogtreecommitdiffstats
path: root/xlators/features/changelog/lib/src/gf-changelog.c
diff options
context:
space:
mode:
authorAnusha Rao <anusha91rao@gmail.com>2015-05-04 12:34:09 +0530
committerVenky Shankar <vshankar@redhat.com>2015-08-11 22:36:44 -0700
commit64e6836ac8fb96f38a859eea0d8525cd9bd2693f (patch)
treeeb00359a9dd7be26f90f9147330a8e2c6fa83232 /xlators/features/changelog/lib/src/gf-changelog.c
parent0dcdc8d9d797ed43d305fb3e3437c2576305ac46 (diff)
features/changelog: Porting log messages to new logging framework
Change-Id: Ic7f842acca52908fd88e0796dc90b82650405b25 BUG: 1194640 Signed-off-by: Anusha Rao <anusha91rao@gmail.com> Reviewed-on: http://review.gluster.org/10532 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Venky Shankar <vshankar@redhat.com> Reviewed-by: Kotresh HR <khiremat@redhat.com>
Diffstat (limited to 'xlators/features/changelog/lib/src/gf-changelog.c')
-rw-r--r--xlators/features/changelog/lib/src/gf-changelog.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/xlators/features/changelog/lib/src/gf-changelog.c b/xlators/features/changelog/lib/src/gf-changelog.c
index 874ffd0d13b..5972e7052d8 100644
--- a/xlators/features/changelog/lib/src/gf-changelog.c
+++ b/xlators/features/changelog/lib/src/gf-changelog.c
@@ -34,6 +34,7 @@
/* from the changelog translator */
#include "changelog-misc.h"
#include "changelog-mem-types.h"
+#include "changelog-lib-messages.h"
/**
* Global singleton xlator pointer for the library, initialized
@@ -243,7 +244,8 @@ gf_changelog_setup_rpc (xlator_t *this,
*/
ret = gf_changelog_invoke_rpc (this, entry, proc);
if (ret) {
- gf_log (this->name, GF_LOG_ERROR,
+ gf_msg (this->name, GF_LOG_ERROR, 0,
+ CHANGELOG_LIB_MSG_INVOKE_RPC_FAILED,
"Could not initiate probe RPC, bailing out!!!");
goto error_return;
}
@@ -261,10 +263,10 @@ gf_cleanup_event (xlator_t *this, struct gf_event_list *ev)
ret = gf_thread_cleanup (this, ev->invoker);
if (ret) {
- gf_log (this->name, GF_LOG_WARNING,
- "cannot cleanup callback invoker thread "
- " [reason: %s]. Not freeing resources",
- strerror (-ret));
+ gf_msg (this->name, GF_LOG_WARNING, -ret,
+ CHANGELOG_LIB_MSG_CLEANUP_ERROR,
+ "cannot cleanup callback invoker thread."
+ " Not freeing resources");
return -1;
}
@@ -395,7 +397,7 @@ gf_setup_brick_connection (xlator_t *this,
cleanup_event:
(void) gf_cleanup_event (this, &entry->event);
free_entry:
- gf_log (this->name, GF_LOG_DEBUG, "freeing entry %p", entry);
+ gf_msg_debug (this->name, 0, "freeing entry %p", entry);
list_del (&entry->list); /* FIXME: kludge for now */
GF_FREE (entry);
error_return:
@@ -459,7 +461,8 @@ gf_changelog_set_master (xlator_t *master, void *xl)
NULL, changelog_rpc_poller, THIS);
if (ret != 0) {
GF_FREE (priv);
- gf_log (master->name, GF_LOG_ERROR,
+ gf_msg (master->name, GF_LOG_ERROR, 0,
+ CHANGELOG_LIB_MSG_THREAD_CREATION_FAILED,
"failed to spawn poller thread");
goto restore_this;
}
@@ -537,13 +540,15 @@ gf_changelog_register_generic (struct gf_brick_spec *bricks, int count,
brick = bricks;
while (count--) {
- gf_log (this->name, GF_LOG_INFO,
+ gf_msg (this->name, GF_LOG_INFO, 0,
+ CHANGELOG_LIB_MSG_NOTIFY_REGISTER_INFO,
"Registering brick: %s [notify filter: %d]",
brick->brick_path, brick->filter);
ret = gf_changelog_register_brick (this, brick, need_order, xl);
if (ret != 0) {
- gf_log (this->name, GF_LOG_ERROR,
+ gf_msg (this->name, GF_LOG_ERROR, 0,
+ CHANGELOG_LIB_MSG_NOTIFY_REGISTER_FAILED,
"Error registering with changelog xlator");
break;
}