diff options
author | arao <arao@redhat.com> | 2015-06-12 16:35:53 +0530 |
---|---|---|
committer | Raghavendra G <rgowdapp@redhat.com> | 2015-06-23 22:15:10 -0700 |
commit | 2b645af1d077957829c8ff6b8ab56353ba3913d6 (patch) | |
tree | fe399a98df744440783a1eec00d6ff9c77ab533f /xlators/cluster/dht/src/switch.c | |
parent | 653d3c1406e372aabcf694bfead2d695f84ee0f8 (diff) |
dht: Adding log messages to the new logging framework
Change-Id: Ib3bb61c5223f409c23c68100f3fe884918d2dc3f
BUG: 1194640
Signed-off-by: arao <arao@redhat.com>
Reviewed-on: http://review.gluster.org/10021
Reviewed-by: N Balachandran <nbalacha@redhat.com>
Reviewed-by: Joseph Fernandes
Tested-by: Joseph Fernandes
Reviewed-by: Dan Lambright <dlambrig@redhat.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Tested-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'xlators/cluster/dht/src/switch.c')
-rw-r--r-- | xlators/cluster/dht/src/switch.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/xlators/cluster/dht/src/switch.c b/xlators/cluster/dht/src/switch.c index c86a0a9b75b..f1e9a399442 100644 --- a/xlators/cluster/dht/src/switch.c +++ b/xlators/cluster/dht/src/switch.c @@ -290,7 +290,8 @@ switch_lookup (call_frame_t *frame, xlator_t *this, ret = dict_set_uint32 (local->xattr_req, conf->xattr_name, 4 * 4); if (ret < 0) - gf_log (this->name, GF_LOG_WARNING, + gf_msg (this->name, GF_LOG_WARNING, 0, + DHT_MSG_DICT_SET_FAILED, "failed to set dict value for %s", conf->xattr_name); @@ -309,14 +310,16 @@ switch_lookup (call_frame_t *frame, xlator_t *this, ret = dict_set_uint32 (local->xattr_req, conf->xattr_name, 4 * 4); if (ret < 0) - gf_log (this->name, GF_LOG_WARNING, + gf_msg (this->name, GF_LOG_WARNING, 0, + DHT_MSG_DICT_SET_FAILED, "failed to set dict value for %s", conf->xattr_name); ret = dict_set_uint32 (local->xattr_req, conf->link_xattr_name, 256); if (ret < 0) - gf_log (this->name, GF_LOG_WARNING, + gf_msg (this->name, GF_LOG_WARNING, EINVAL, + DHT_MSG_DICT_SET_FAILED, "failed to set dict value for %s", conf->link_xattr_name); @@ -657,7 +660,8 @@ set_switch_pattern (xlator_t *this, dht_conf_t *conf, pattern = strtok_r (dup_str, ":", &tmp_str1); childs = strtok_r (NULL, ":", &tmp_str1); if (strncmp (pattern, "*", 2) == 0) { - gf_log ("switch", GF_LOG_INFO, + gf_msg ("switch", GF_LOG_INFO, 0, + DHT_MSG_SWITCH_PATTERN_INFO, "'*' pattern will be taken by default " "for all the unconfigured child nodes," " hence neglecting current option"); @@ -676,7 +680,8 @@ set_switch_pattern (xlator_t *this, dht_conf_t *conf, idx++; child = strtok_r (NULL, ",", &tmp); } else { - gf_log (this->name, GF_LOG_ERROR, + gf_msg (this->name, GF_LOG_ERROR, 0, + DHT_MSG_SUBVOL_ERROR, "%s is not a subvolume of %s. " "pattern can only be scheduled " "only to a subvolume of %s", @@ -718,7 +723,8 @@ set_switch_pattern (xlator_t *this, dht_conf_t *conf, } } else { /* error */ - gf_log ("switch", GF_LOG_ERROR, + gf_msg ("switch", GF_LOG_ERROR, 0, + DHT_MSG_SET_SWITCH_PATTERN_ERROR, "Check \"scheduler.switch.case\" " "option in unify volume. Exiting"); goto err; @@ -750,7 +756,8 @@ set_switch_pattern (xlator_t *this, dht_conf_t *conf, flag++; } if (!flag) { - gf_log ("switch", GF_LOG_ERROR, + gf_msg ("switch", GF_LOG_ERROR, 0, + DHT_MSG_SET_SWITCH_PATTERN_ERROR, "No nodes left for pattern '*'. Exiting"); goto err; } |