From b3c9fdacce4057e1ca8275dd095782ac4004dd92 Mon Sep 17 00:00:00 2001 From: Nandaja Varma Date: Mon, 9 Mar 2015 16:59:54 +0530 Subject: glusterd: Porting messages to new logging framework. Backport of http://review.gluster.org/#/c/9836/ Change-Id: I56ced6fca0246c230cc389132c47a0f60472ed0c BUG: 1217722 Signed-off-by: Nandaja Varma Reviewed-on: http://review.gluster.org/9836 Tested-by: NetBSD Build System Tested-by: Gluster Build System Reviewed-by: Atin Mukherjee (cherry picked from commit 2ae034374ce449c54b1b4ae8350401371db1d8d3) Reviewed-on: http://review.gluster.org/11221 --- xlators/mgmt/glusterd/src/glusterd-volume-set.c | 28 +++++++++++++++---------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-volume-set.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c index 8dea0695d67..aed24469608 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c +++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c @@ -61,14 +61,15 @@ validate_cache_max_min_size (glusterd_volinfo_t *volinfo, dict_t *dict, "cache-min-file-size (%s) is greater than " "cache-max-file-size (%s)", current_min_value, current_max_value); - gf_log (this->name, GF_LOG_ERROR, "%s", errstr); + gf_msg (this->name, GF_LOG_ERROR, 0, + GD_MSG_CACHE_MINMAX_SIZE_INVALID, "%s", errstr); *op_errstr = gf_strdup (errstr); ret = -1; goto out; } out: - gf_log (this->name, GF_LOG_DEBUG, "Returning %d", ret); + gf_msg_debug (this->name, 0, "Returning %d", ret); return ret; } @@ -118,7 +119,8 @@ validate_quota (glusterd_volinfo_t *volinfo, dict_t *dict, char *key, ret = glusterd_volinfo_get_boolean (volinfo, VKEY_FEATURES_QUOTA); if (ret == -1) { - gf_log (this->name, GF_LOG_ERROR, + gf_msg (this->name, GF_LOG_ERROR, 0, + GD_MSG_QUOTA_GET_STAT_FAIL, "failed to get the quota status"); goto out; } @@ -126,7 +128,8 @@ validate_quota (glusterd_volinfo_t *volinfo, dict_t *dict, char *key, if (ret == _gf_false) { snprintf (errstr, sizeof (errstr), "Cannot set %s. Enable quota first.", key); - gf_log (this->name, GF_LOG_ERROR, "%s", errstr); + gf_msg (this->name, GF_LOG_ERROR, 0, + GD_MSG_QUOTA_DISABLED, "%s", errstr); *op_errstr = gf_strdup (errstr); ret = -1; goto out; @@ -134,7 +137,7 @@ validate_quota (glusterd_volinfo_t *volinfo, dict_t *dict, char *key, ret = 0; out: - gf_log (this->name, GF_LOG_DEBUG, "Returning %d", ret); + gf_msg_debug (this->name, 0, "Returning %d", ret); return ret; } @@ -156,12 +159,13 @@ validate_uss (glusterd_volinfo_t *volinfo, dict_t *dict, char *key, snprintf (errstr, sizeof (errstr), "%s is not a valid boolean " "value. %s expects a valid boolean value.", value, key); - gf_log (this->name, GF_LOG_ERROR, "%s", errstr); + gf_msg (this->name, GF_LOG_ERROR, 0, + GD_MSG_INVALID_ENTRY, "%s", errstr); *op_errstr = gf_strdup (errstr); goto out; } out: - gf_log (this->name, GF_LOG_DEBUG, "Returning %d", ret); + gf_msg_debug (this->name, 0, "Returning %d", ret); return ret; } @@ -183,14 +187,15 @@ validate_stripe (glusterd_volinfo_t *volinfo, dict_t *dict, char *key, if (volinfo->stripe_count == 1) { snprintf (errstr, sizeof (errstr), "Cannot set %s for a non-stripe volume.", key); - gf_log (this->name, GF_LOG_ERROR, "%s", errstr); + gf_msg (this->name, GF_LOG_ERROR, 0, + GD_MSG_NON_STRIPE_VOL, "%s", errstr); *op_errstr = gf_strdup (errstr); ret = -1; goto out; } out: - gf_log (this->name, GF_LOG_DEBUG, "Returning %d", ret); + gf_msg_debug (this->name, 0, "Returning %d", ret); return ret; } @@ -219,7 +224,8 @@ validate_subvols_per_directory (glusterd_volinfo_t *volinfo, dict_t *dict, "subvols-per-directory(%d) is greater " "than the number of subvolumes(%d).", subvols, volinfo->subvol_count); - gf_log (this->name, GF_LOG_ERROR, + gf_msg (this->name, GF_LOG_ERROR, 0, + GD_MSG_SUBVOLUMES_EXCEED, "%s.", errstr); *op_errstr = gf_strdup (errstr); ret = -1; @@ -227,7 +233,7 @@ validate_subvols_per_directory (glusterd_volinfo_t *volinfo, dict_t *dict, } out: - gf_log (this->name, GF_LOG_DEBUG, "Returning %d", ret); + gf_msg_debug (this->name, 0, "Returning %d", ret); return ret; } -- cgit