You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by da...@apache.org on 2016/12/23 03:37:56 UTC
[2/3] kudu git commit: KUDU-1812. Fix printed default of redaction
flag for tools
KUDU-1812. Fix printed default of redaction flag for tools
A previous commit made the default redaction mode for tools get set
after parsing command line options. This means that "--help" would be
not have the correct default displayed.
This changes to using the appropriate gflags API to change the default
programatically.
Change-Id: I5f2535302122c8dc637c67cced88e77a47e62f15
Reviewed-on: http://gerrit.cloudera.org:8080/5574
Reviewed-by: Adar Dembo <ad...@cloudera.com>
Tested-by: Kudu Jenkins
(cherry picked from commit 9efb2f8640b8135a935fb3497282f48a3c13bd3a)
Reviewed-on: http://gerrit.cloudera.org:8080/5575
Reviewed-by: Dan Burkert <da...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/a5a7b1eb
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/a5a7b1eb
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/a5a7b1eb
Branch: refs/heads/branch-1.2.x
Commit: a5a7b1ebd029610c97e6473814ada45f0aec9ffc
Parents: b52e2a1
Author: Todd Lipcon <to...@apache.org>
Authored: Fri Dec 23 08:33:38 2016 +0700
Committer: Dan Burkert <da...@apache.org>
Committed: Fri Dec 23 03:36:30 2016 +0000
----------------------------------------------------------------------
src/kudu/tools/tool_main.cc | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kudu/blob/a5a7b1eb/src/kudu/tools/tool_main.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tools/tool_main.cc b/src/kudu/tools/tool_main.cc
index d48d95e..a9dd0e7 100644
--- a/src/kudu/tools/tool_main.cc
+++ b/src/kudu/tools/tool_main.cc
@@ -222,14 +222,14 @@ static bool ParseCommandLineFlags(int* argc, char*** argv) {
}
int main(int argc, char** argv) {
+ // Disable redaction by default so that user data printed to the console will be shown
+ // in full.
+ CHECK_NE("", google::SetCommandLineOptionWithMode(
+ "log_redact_user_data", "false", google::SET_FLAGS_DEFAULT));
+
FLAGS_logtostderr = true;
bool show_help = ParseCommandLineFlags(&argc, &argv);
- if (google::GetCommandLineFlagInfoOrDie("log_redact_user_data").is_default) {
- // Disable redaction so that user data printed to the console will be shown in full.
- FLAGS_log_redact_user_data = false;
- }
-
kudu::InitGoogleLoggingSafe(argv[0]);
return kudu::tools::RunTool(argc, argv, show_help);
}