diff options
author | Mohamed Ashiq <ashiq333@gmail.com> | 2015-05-19 15:46:01 +0530 |
---|---|---|
committer | Niels de Vos <ndevos@redhat.com> | 2015-07-14 02:35:13 -0700 |
commit | 2ab34a9c675a6167caed3326b6973854e8529843 (patch) | |
tree | eb72424b707ccf82866b9e1e6e55a576d02e5b65 /libglusterfs/src/timer.c | |
parent | 8e19c820dc1427d6bf552562c5df18a5884fd02b (diff) |
mem-pool,stack,store,syncop,timer/libglusterfs : Porting to a new logging framework
Backport of http://review.gluster.org/10827
Cherry picked from 2b9b3ef3b646989bbc0412dca187b3f5fcad3283
>Change-Id: Idd3dcaf7eeea5207b3a5210676ce3df64153197f
>BUG: 1194640
>Signed-off-by: Mohamed Ashiq <ashiq333@gmail.com>
>Reviewed-on: http://review.gluster.org/10827
>Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
>Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Change-Id: Idd3dcaf7eeea5207b3a5210676ce3df64153197f
BUG: 1217722
Signed-off-by: Mohamed Ashiq <ashiq333@gmail.com>
Reviewed-on: http://review.gluster.org/11478
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Diffstat (limited to 'libglusterfs/src/timer.c')
-rw-r--r-- | libglusterfs/src/timer.c | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/libglusterfs/src/timer.c b/libglusterfs/src/timer.c index 0d845cdeb38..8344c9bc5d5 100644 --- a/libglusterfs/src/timer.c +++ b/libglusterfs/src/timer.c @@ -18,6 +18,7 @@ #include "common-utils.h" #include "globals.h" #include "timespec.h" +#include "libglusterfs-messages.h" gf_timer_t * gf_timer_call_after (glusterfs_ctx_t *ctx, @@ -32,7 +33,8 @@ gf_timer_call_after (glusterfs_ctx_t *ctx, if (ctx == NULL) { - gf_log_callingfn ("timer", GF_LOG_ERROR, "invalid argument"); + gf_msg_callingfn ("timer", GF_LOG_ERROR, EINVAL, + LG_MSG_INVALID_ARG, "invalid argument"); return NULL; } @@ -41,14 +43,17 @@ gf_timer_call_after (glusterfs_ctx_t *ctx, * when cleanup_started is set after checking for it */ if (ctx->cleanup_started) { - gf_log_callingfn ("timer", GF_LOG_INFO, "ctx cleanup started"); + gf_msg_callingfn ("timer", GF_LOG_INFO, 0, + LG_MSG_CTX_CLEANUP_STARTED, "ctx cleanup " + "started"); return NULL; } reg = gf_timer_registry_init (ctx); if (!reg) { - gf_log_callingfn ("timer", GF_LOG_ERROR, "!reg"); + gf_msg_callingfn ("timer", GF_LOG_ERROR, 0, + LG_MSG_TIMER_REGISTER_ERROR, "!reg"); return NULL; } @@ -85,7 +90,8 @@ gf_timer_call_stale (gf_timer_registry_t *reg, { if (reg == NULL || event == NULL) { - gf_log_callingfn ("timer", GF_LOG_ERROR, "invalid argument"); + gf_msg_callingfn ("timer", GF_LOG_ERROR, EINVAL, + LG_MSG_INVALID_ARG, "invalid argument"); return 0; } @@ -107,13 +113,15 @@ gf_timer_call_cancel (glusterfs_ctx_t *ctx, if (ctx == NULL || event == NULL) { - gf_log_callingfn ("timer", GF_LOG_ERROR, "invalid argument"); + gf_msg_callingfn ("timer", GF_LOG_ERROR, EINVAL, + LG_MSG_INVALID_ARG, "invalid argument"); return 0; } reg = gf_timer_registry_init (ctx); if (!reg) { - gf_log ("timer", GF_LOG_ERROR, "!reg"); + gf_msg ("timer", GF_LOG_ERROR, 0, LG_MSG_INIT_TIMER_FAILED, + "!reg"); GF_FREE (event); return 0; } @@ -145,13 +153,15 @@ gf_timer_proc (void *ctx) if (ctx == NULL) { - gf_log_callingfn ("timer", GF_LOG_ERROR, "invalid argument"); + gf_msg_callingfn ("timer", GF_LOG_ERROR, EINVAL, + LG_MSG_INVALID_ARG, "invalid argument"); return NULL; } reg = gf_timer_registry_init (ctx); if (!reg) { - gf_log ("timer", GF_LOG_ERROR, "!reg"); + gf_msg ("timer", GF_LOG_ERROR, 0, LG_MSG_INIT_TIMER_FAILED, + "!reg"); return NULL; } @@ -223,7 +233,8 @@ gf_timer_registry_t * gf_timer_registry_init (glusterfs_ctx_t *ctx) { if (ctx == NULL) { - gf_log_callingfn ("timer", GF_LOG_ERROR, "invalid argument"); + gf_msg_callingfn ("timer", GF_LOG_ERROR, EINVAL, + LG_MSG_INVALID_ARG, "invalid argument"); return NULL; } |