summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/globals.c
diff options
context:
space:
mode:
authorMohamed Ashiq <ashiq333@gmail.com>2015-05-19 15:40:30 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2015-06-24 23:31:52 -0700
commitef374774b8727b2f76915a1f88b26c83c77dde43 (patch)
treef818d8a450cfad6b7b3d598d3c623a7aafc645a1 /libglusterfs/src/globals.c
parenta9b6933ef097d2a81ce21a8aeda2acc569cd1509 (diff)
defaults,globals,iobuf,latency,logging,options,xlator/libglusterfs : porting to a new logging framework
Change-Id: If6a55186cddc3d1c4d22e3d56b45358b84feeb49 BUG: 1194640 Signed-off-by: Mohamed Ashiq <ashiq333@gmail.com> Reviewed-on: http://review.gluster.org/10826 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'libglusterfs/src/globals.c')
-rw-r--r--libglusterfs/src/globals.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/libglusterfs/src/globals.c b/libglusterfs/src/globals.c
index a875049dfec..4f48cd169b5 100644
--- a/libglusterfs/src/globals.c
+++ b/libglusterfs/src/globals.c
@@ -15,6 +15,7 @@
#include "xlator.h"
#include "mem-pool.h"
#include "syncop.h"
+#include "libglusterfs-messages.h"
const char *gf_fop_list[GF_FOP_MAXVALUE] = {
[GF_FOP_NULL] = "NULL",
@@ -108,7 +109,9 @@ glusterfs_this_init ()
ret = pthread_key_create (&this_xlator_key, glusterfs_this_destroy);
if (ret != 0) {
- gf_log ("", GF_LOG_WARNING, "failed to create the pthread key");
+ gf_msg ("", GF_LOG_WARNING, ret,
+ LG_MSG_PTHREAD_KEY_CREATE_FAILED, "failed to create "
+ "the pthread key");
return ret;
}
@@ -333,43 +336,43 @@ gf_globals_init_once ()
ret = glusterfs_this_init ();
if (ret) {
- gf_log ("", GF_LOG_CRITICAL,
+ gf_msg ("", GF_LOG_CRITICAL, 0, LG_MSG_TRANSLATOR_INIT_FAILED,
"ERROR: glusterfs-translator init failed");
goto out;
}
ret = glusterfs_uuid_buf_init ();
if(ret) {
- gf_log ("", GF_LOG_CRITICAL,
+ gf_msg ("", GF_LOG_CRITICAL, 0, LG_MSG_UUID_BUF_INIT_FAILED,
"ERROR: glusterfs uuid buffer init failed");
goto out;
}
ret = glusterfs_lkowner_buf_init ();
if(ret) {
- gf_log ("", GF_LOG_CRITICAL,
+ gf_msg ("", GF_LOG_CRITICAL, 0, LG_MSG_LKOWNER_BUF_INIT_FAILED,
"ERROR: glusterfs lkowner buffer init failed");
goto out;
}
ret = synctask_init ();
if (ret) {
- gf_log ("", GF_LOG_CRITICAL,
+ gf_msg ("", GF_LOG_CRITICAL, 0, LG_MSG_SYNCTASK_INIT_FAILED,
"ERROR: glusterfs synctask init failed");
goto out;
}
ret = syncopctx_init ();
if (ret) {
- gf_log ("", GF_LOG_CRITICAL,
+ gf_msg ("", GF_LOG_CRITICAL, 0, LG_MSG_SYNCOPCTX_INIT_FAILED,
"ERROR: glusterfs syncopctx init failed");
goto out;
}
out:
if (ret) {
- gf_log ("", GF_LOG_CRITICAL, "Exiting as global "
- "initialization failed");
+ gf_msg ("", GF_LOG_CRITICAL, 0, LG_MSG_GLOBAL_INIT_FAILED,
+ "Exiting as global initialization failed");
exit (ret);
}
}
@@ -384,8 +387,8 @@ glusterfs_globals_init (glusterfs_ctx_t *ctx)
ret = pthread_once (&globals_inited, gf_globals_init_once);
if (ret)
- gf_log ("", GF_LOG_CRITICAL, "pthread_once failed with: %d",
- ret);
+ gf_msg ("", GF_LOG_CRITICAL, ret, LG_MSG_PTHREAD_FAILED,
+ "pthread_once failed");
return ret;
}