From ef374774b8727b2f76915a1f88b26c83c77dde43 Mon Sep 17 00:00:00 2001 From: Mohamed Ashiq Date: Tue, 19 May 2015 15:40:30 +0530 Subject: defaults,globals,iobuf,latency,logging,options,xlator/libglusterfs : porting to a new logging framework Change-Id: If6a55186cddc3d1c4d22e3d56b45358b84feeb49 BUG: 1194640 Signed-off-by: Mohamed Ashiq Reviewed-on: http://review.gluster.org/10826 Tested-by: NetBSD Build System Reviewed-by: Pranith Kumar Karampuri --- libglusterfs/src/globals.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'libglusterfs/src/globals.c') 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; } -- cgit