summaryrefslogtreecommitdiffstats
path: root/cli/src/cli-cmd-volume.c
diff options
context:
space:
mode:
authorVenky Shankar <venky@gluster.com>2011-04-25 03:10:01 +0000
committerAnand Avati <avati@gluster.com>2011-05-20 11:01:49 -0700
commit2cd8411a0278f98ed820aad3e482de079d0540c0 (patch)
tree66cd9fa15fe8d269277b41469c3f45a12f59c24b /cli/src/cli-cmd-volume.c
parent03c58c782d99440a5947289d0ff216bca8ef7c57 (diff)
cli log level command and per translator log level
Signed-off-by: Venky Shankar <venky@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2714 (implement cli log level command) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2714
Diffstat (limited to 'cli/src/cli-cmd-volume.c')
-rw-r--r--cli/src/cli-cmd-volume.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c
index 673202440fc..7ca9ed4bb2f 100644
--- a/cli/src/cli-cmd-volume.c
+++ b/cli/src/cli-cmd-volume.c
@@ -1171,6 +1171,39 @@ out:
return ret;
}
+int
+cli_cmd_log_level_cbk (struct cli_state *state, struct cli_cmd_word *word,
+ const char **words, int wordcount)
+{
+ int ret = -1;
+ rpc_clnt_procedure_t *proc = NULL;
+ call_frame_t *frame = NULL;
+ dict_t *dict = NULL;
+ int parse_error = 0;
+
+ if (wordcount != 6) {
+ cli_usage_out (word->pattern);
+ parse_error = 1;
+ goto out;
+ }
+
+ proc = &cli_rpc_prog->proctable[GLUSTER_CLI_LOG_LEVEL];
+
+ frame = create_frame (THIS, THIS->ctx->pool);
+ if (!frame)
+ goto out;
+
+ ret = cli_cmd_log_level_parse (words, wordcount, &dict);
+ if (ret)
+ goto out;
+
+ if (proc->fn)
+ ret = proc->fn (frame, THIS, dict);
+
+ out:
+ return ret;
+}
+
struct cli_cmd volume_cmds[] = {
{ "volume info [all|<VOLNAME>]",
cli_cmd_volume_info_cbk,
@@ -1265,6 +1298,10 @@ struct cli_cmd volume_cmds[] = {
cli_cmd_volume_top_cbk,
"volume top operations"},
+ {"volume log level <VOLNAME> <XLATOR[*]> <LOGLEVEL>",
+ cli_cmd_log_level_cbk,
+ "log level for translator"},
+
{ NULL, NULL, NULL }
};