From 70ae565c759cb019b73c7b4d6ac3650293984bc2 Mon Sep 17 00:00:00 2001 From: Ravishankar N Date: Wed, 28 Nov 2018 15:19:24 +0530 Subject: glfsheal: add a '--nolog' flag ....and if set, change the log level to GF_LOG_NONE. This is useful for monitoring applications which invoke the heal info set of commands once every minute, leading to un-necessary glfsheal* logs in /var/log/glusterfs/. For example, we can now run `gluster volume heal info --nolog` `gluster volume heal info split-brain --nolog` etc. The default log level is still retained at GF_LOG_INFO. The patch also changes glfsheal internally to accept '--xml' instead of 'xml'. Note: The --nolog flag is *not* displayed in the help anywhere, for the sake of consistency in how the other flags are not displayed anywhere in the help. fixes: bz#1654229 Change-Id: Ia08b6aa6e4a0548379db7e313dd4411ebc66f206 Signed-off-by: Ravishankar N --- cli/src/cli.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'cli/src/cli.c') diff --git a/cli/src/cli.c b/cli/src/cli.c index b58f211d3dd..dd49198feed 100644 --- a/cli/src/cli.c +++ b/cli/src/cli.c @@ -347,6 +347,11 @@ cli_opt_parse (char *opt, struct cli_state *state) return 0; } + if (strcmp(opt, "nolog") == 0) { + state->mode |= GLUSTER_MODE_GLFSHEAL_NOLOG; + return 0; + } + if (strcmp (opt, "wignore-partition") == 0) { state->mode |= GLUSTER_MODE_WIGNORE_PARTITION; return 0; -- cgit