summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/globals.c
diff options
context:
space:
mode:
authorMohamed Ashiq <ashiq333@gmail.com>2015-05-19 15:40:30 +0530
committerNiels de Vos <ndevos@redhat.com>2015-07-13 06:10:58 -0700
commit1e4cc18362df17f87001ec42605b51daf251e0db (patch)
tree3e948e6a44979b7316b73a8f931e7e537716bf03 /libglusterfs/src/globals.c
parent0497fb6090d1ed34ac1bdcaaff49847025d13e9e (diff)
defaults,globals,iobuf,latency,logging,options,xlator/libglusterfs : porting to a new logging framework
Backport of http://review.gluster.org/10826 Cherry picked from ef374774b8727b2f76915a1f88b26c83c77dde43 >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> Change-Id: If6a55186cddc3d1c4d22e3d56b45358b84feeb49 BUG: 1217722 Signed-off-by: Mohamed Ashiq <ashiq333@gmail.com> Reviewed-on: http://review.gluster.org/11405 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Niels de Vos <ndevos@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 bd1165ec50c..8943637ef62 100644
--- a/libglusterfs/src/globals.c
+++ b/libglusterfs/src/globals.c
@@ -20,6 +20,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",
@@ -113,7 +114,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;
}
@@ -338,43 +341,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);
}
}
@@ -389,8 +392,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;
}