summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/options.h
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/options.h
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/options.h')
-rw-r--r--libglusterfs/src/options.h31
1 files changed, 16 insertions, 15 deletions
diff --git a/libglusterfs/src/options.h b/libglusterfs/src/options.h
index 05a3d4332cf..fa798db05ed 100644
--- a/libglusterfs/src/options.h
+++ b/libglusterfs/src/options.h
@@ -21,6 +21,7 @@
#include <inttypes.h>
#include "xlator.h"
+#include "libglusterfs-messages.h"
/* Add possible new type of option you may need */
typedef enum {
GF_OPTION_TYPE_ANY = 0,
@@ -133,7 +134,8 @@ xlator_option_init_##type (xlator_t *this, dict_t *options, char *key, \
\
opt = xlator_volume_option_get (this, key); \
if (!opt) { \
- gf_log (this->name, GF_LOG_WARNING, \
+ gf_msg (this->name, GF_LOG_WARNING, EINVAL, \
+ LG_MSG_INVALID_ENTRY, \
"unknown option: %s", key); \
ret = -1; \
return ret; \
@@ -146,27 +148,26 @@ xlator_option_init_##type (xlator_t *this, dict_t *options, char *key, \
if (set_value) \
value = set_value; \
if (!value) { \
- gf_log (this->name, GF_LOG_TRACE, "option %s not set", \
+ gf_msg_trace (this->name, 0, "option %s not set", \
key); \
*val_p = (type_t)0; \
return 0; \
} \
if (value == def_value) { \
- gf_log (this->name, GF_LOG_TRACE, \
- "option %s using default value %s", \
- key, value); \
+ gf_msg_trace (this->name, 0, "option %s using default" \
+ " value %s", key, value); \
} else { \
- gf_log (this->name, GF_LOG_DEBUG, \
- "option %s using set value %s", \
- key, value); \
+ gf_msg_debug (this->name, 0, "option %s using set" \
+ " value %s", key, value); \
} \
old_THIS = THIS; \
THIS = this; \
ret = conv (value, val_p); \
THIS = old_THIS; \
if (ret) { \
- gf_log (this->name, GF_LOG_INFO, \
- "option %s convertion failed value %s", \
+ gf_msg (this->name, GF_LOG_INFO, 0, \
+ LG_MSG_CONVERSION_FAILED, \
+ "option %s conversion failed value %s", \
key, value); \
return ret; \
} \
@@ -219,7 +220,8 @@ xlator_option_reconf_##type (xlator_t *this, dict_t *options, char *key, \
\
opt = xlator_volume_option_get (this, key); \
if (!opt) { \
- gf_log (this->name, GF_LOG_WARNING, \
+ gf_msg (this->name, GF_LOG_WARNING, EINVAL, \
+ LG_MSG_INVALID_ENTRY, \
"unknown option: %s", key); \
ret = -1; \
return ret; \
@@ -232,17 +234,16 @@ xlator_option_reconf_##type (xlator_t *this, dict_t *options, char *key, \
if (set_value) \
value = set_value; \
if (!value) { \
- gf_log (this->name, GF_LOG_TRACE, "option %s not set", \
- key); \
+ gf_msg_trace (this->name, 0, "option %s not set", key); \
*val_p = (type_t)0; \
return 0; \
} \
if (value == def_value) { \
- gf_log (this->name, GF_LOG_TRACE, \
+ gf_msg_trace (this->name, 0, \
"option %s using default value %s", \
key, value); \
} else { \
- gf_log (this->name, GF_LOG_DEBUG, \
+ gf_msg_debug (this->name, 0, \
"option %s using set value %s", \
key, value); \
} \