From 62564fa2aaf1ada2b29255db82cc1c2a520decd0 Mon Sep 17 00:00:00 2001 From: Vijay Bellur Date: Mon, 5 Jan 2015 16:02:40 +0530 Subject: cli: logging improvements 1. cli used to log messages at all log levels. This is related to a peculiar behavior of gcc which treats any enum variable whose type has non-negative only defined values to be an unsigned integer. This would cause cli's loglevel (defaulted from state->loglevel) to be set as (uint)-1 previously and hence all log messages across levels would appear in the cli log file. Now cli's loglevel defaults to log level INFO. 2. Changed logging level of messages of type "Returning %d".. to DEBUG. Change-Id: I05094e523fc277d9ad32cc9d76aee873c0fd3859 BUG: 1224624 Signed-off-by: Vijay Bellur Reviewed-on: http://review.gluster.org/9383 Reviewed-by: Atin Mukherjee Reviewed-by: Raghavendra Bhat Tested-by: Gluster Build System Reviewed-by: Krishnan Parthasarathi Tested-by: Krishnan Parthasarathi Reviewed-on: http://review.gluster.org/10904 --- cli/src/cli-rpc-ops.c | 6 +++--- cli/src/cli-xml-output.c | 2 +- cli/src/cli.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index 53464d79fac..2bacbc96270 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -861,7 +861,7 @@ out: free (rsp.op_errstr); - gf_log ("cli", GF_LOG_INFO, "Returning: %d", ret); + gf_log ("cli", GF_LOG_DEBUG, "Returning: %d", ret); return ret; } @@ -1010,7 +1010,7 @@ out: cli_cmd_broadcast_response (ret); free (rsp.dict.dict_val); - gf_log ("", GF_LOG_INFO, "Returning with %d", ret); + gf_log ("", GF_LOG_DEBUG, "Returning with %d", ret); return ret; } @@ -1148,7 +1148,7 @@ out: if (dict) dict_unref (dict); - gf_log ("", GF_LOG_INFO, "Returning with %d", ret); + gf_log ("", GF_LOG_DEBUG, "Returning with %d", ret); return ret; } diff --git a/cli/src/cli-xml-output.c b/cli/src/cli-xml-output.c index f5806e5d42c..922711dc2be 100644 --- a/cli/src/cli-xml-output.c +++ b/cli/src/cli-xml-output.c @@ -2864,7 +2864,7 @@ cli_xml_output_vol_info_end (cli_local_t *local) ret = cli_end_xml_output (local->writer, local->doc); out: - gf_log ("cli", GF_LOG_ERROR, "Returning %d", ret); + gf_log ("cli", GF_LOG_DEBUG, "Returning %d", ret); return ret; #else return 0; diff --git a/cli/src/cli.c b/cli/src/cli.c index 992f6a54321..296300b890f 100644 --- a/cli/src/cli.c +++ b/cli/src/cli.c @@ -451,7 +451,7 @@ cli_state_init (struct cli_state *state) int ret = 0; - state->log_level = -1; + state->log_level = GF_LOG_NONE; tree = &state->tree; tree->state = state; -- cgit