diff options
author | arao <arao@redhat.com> | 2015-06-12 16:35:53 +0530 |
---|---|---|
committer | Raghavendra G <rgowdapp@redhat.com> | 2015-07-27 00:21:48 -0700 |
commit | 73517fedf7840363b9f688183e604a617d934652 (patch) | |
tree | af6e03acd0d45a81b555cd8c0a123c3baa5fbd0e /xlators/cluster/dht/src/dht-shared.c | |
parent | 5ebf298ec03bc929a4142e70ed105130cf9c58df (diff) |
dht: Adding log messages to the new logging framework
Backported from: http://review.gluster.org/10021
> Change-Id: Ib3bb61c5223f409c23c68100f3fe884918d2dc3f
> BUG: 1194640
> Reviewed-on: http://review.gluster.org/10021
> Reviewed-by: N Balachandran <nbalacha@redhat.com>
> Reviewed-by: Joseph Fernandes <josferna@redhat.com>
> Tested-by: Joseph Fernandes <josferna@redhat.com>
> Reviewed-by: Dan Lambright <dlambrig@redhat.com>
> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
> Tested-by: Raghavendra G <rgowdapp@redhat.com>
> Signed-off-by: arao <arao@redhat.com>
BUG: 1217722
Change-Id: Ide79c6c1e6a466fb52f955c90a2b22711bec794a
Signed-off-by: arao <arao@redhat.com>
Signed-off-by: Anusha Rao <arao@redhat.com>
Reviewed-on: http://review.gluster.org/11350
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators/cluster/dht/src/dht-shared.c')
-rw-r--r-- | xlators/cluster/dht/src/dht-shared.c | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/xlators/cluster/dht/src/dht-shared.c b/xlators/cluster/dht/src/dht-shared.c index 456d83150fc..ce0fd000a97 100644 --- a/xlators/cluster/dht/src/dht-shared.c +++ b/xlators/cluster/dht/src/dht-shared.c @@ -264,8 +264,9 @@ mem_acct_init (xlator_t *this) ret = xlator_mem_acct_init (this, gf_dht_mt_end + 1); if (ret != 0) { - gf_log (this->name, GF_LOG_ERROR, "Memory accounting init" - "failed"); + gf_msg (this->name, GF_LOG_ERROR, 0, + DHT_MSG_NO_MEMORY, + "Memory accounting init failed"); return ret; } out: @@ -294,7 +295,8 @@ dht_parse_decommissioned_bricks (xlator_t *this, dht_conf_t *conf, conf->decommissioned_bricks[i] = conf->subvolumes[i]; conf->decommission_subvols_cnt++; - gf_log (this->name, GF_LOG_INFO, + gf_msg (this->name, GF_LOG_INFO, 0, + DHT_MSG_SUBVOL_DECOMMISSION_INFO, "decommissioning subvolume %s", conf->subvolumes[i]->name); break; @@ -359,12 +361,13 @@ dht_init_regex (xlator_t *this, dict_t *odict, char *name, } if (regcomp(re,temp_str,REG_EXTENDED) == 0) { - gf_log (this->name, GF_LOG_DEBUG, - "using regex %s = %s", name, temp_str); + gf_msg_debug (this->name, 0, + "using regex %s = %s", name, temp_str); *re_valid = _gf_true; } else { - gf_log (this->name, GF_LOG_WARNING, + gf_msg (this->name, GF_LOG_WARNING, 0, + DHT_MSG_REGEX_INFO, "compiling regex %s failed", temp_str); } } @@ -458,7 +461,9 @@ dht_reconfigure (xlator_t *this, dict_t *options) if (conf->defrag) { GF_DECIDE_DEFRAG_THROTTLE_COUNT (throttle_count, conf); - gf_log ("DHT", GF_LOG_INFO, "conf->dthrottle: %s, " + gf_msg ("DHT", GF_LOG_INFO, 0, + DHT_MSG_REBAL_THROTTLE_INFO, + "conf->dthrottle: %s, " "conf->defrag->recon_thread_count: %d", conf->dthrottle, conf->defrag->recon_thread_count); } @@ -597,7 +602,8 @@ dht_init (xlator_t *this) /* We get the commit-hash to set only for rebalance process */ if (dict_get_uint32 (this->options, "commit-hash", &commit_hash) == 0) { - gf_log (this->name, GF_LOG_INFO, "%s using commit hash %u", + gf_msg (this->name, GF_LOG_INFO, 0, + DHT_MSG_COMMIT_HASH_INFO, "%s using commit hash %u", __func__, commit_hash); conf->vol_commit_hash = commit_hash; conf->vch_forced = _gf_true; @@ -722,7 +728,8 @@ dht_init (xlator_t *this) if (cmd) { ret = dht_init_local_subvolumes (this, conf); if (ret) { - gf_log (this->name, GF_LOG_ERROR, + gf_msg (this->name, GF_LOG_ERROR, 0, + DHT_MSG_INIT_LOCAL_SUBVOL_FAILED, "dht_init_local_subvolumes failed"); goto err; } @@ -751,8 +758,8 @@ dht_init (xlator_t *this) this->local_pool = mem_pool_new (dht_local_t, 512); if (!this->local_pool) { - gf_msg (this->name, GF_LOG_ERROR, 0, - DHT_MSG_INIT_FAILED, + gf_msg (this->name, GF_LOG_ERROR, ENOMEM, + DHT_MSG_NO_MEMORY, " DHT initialisation failed. " "failed to create local_t's memory pool"); goto err; @@ -767,9 +774,10 @@ dht_init (xlator_t *this) GF_DECIDE_DEFRAG_THROTTLE_COUNT(throttle_count, conf); - gf_log ("DHT", GF_LOG_DEBUG, "conf->dthrottle: %s, " - "conf->defrag->recon_thread_count: %d", - conf->dthrottle, conf->defrag->recon_thread_count); + gf_msg_debug ("DHT", 0, "conf->dthrottle: %s, " + "conf->defrag->recon_thread_count: %d", + conf->dthrottle, + conf->defrag->recon_thread_count); } GF_OPTION_INIT ("xattr-name", conf->xattr_name, str, err); |