summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/options.h
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/options.h
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/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 83b545850c8..3154dcefc02 100644
--- a/libglusterfs/src/options.h
+++ b/libglusterfs/src/options.h
@@ -16,6 +16,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,
@@ -128,7 +129,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; \
@@ -141,27 +143,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; \
} \
@@ -214,7 +215,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; \
@@ -227,17 +229,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); \
} \