Set TRACE_FORMAT network option in fdbcli

Previously --trace_format did not work since the network option has the
last say in what trace format to use.
This commit is contained in:
Andrew Noyes 2019-03-22 10:35:05 -07:00
parent 91019712dd
commit 555405d1ab
1 changed files with 6 additions and 1 deletions

View File

@ -2302,6 +2302,7 @@ struct CLIOptions {
std::string clusterFile;
bool trace;
std::string traceDir;
std::string traceFormat;
int exit_timeout;
Optional<std::string> exec;
bool initialStatusCheck;
@ -2398,9 +2399,10 @@ struct CLIOptions {
case OPT_STATUS_FROM_JSON:
return printStatusFromJSON(args.OptionArg());
case OPT_TRACE_FORMAT:
if (!selectTraceFormatter(args.OptionArg())) {
if (!validateTraceFormat(args.OptionArg())) {
fprintf(stderr, "WARNING: Unrecognized trace format `%s'\n", args.OptionArg());
}
traceFormat = args.OptionArg();
break;
case OPT_VERSION:
printVersion();
@ -3395,6 +3397,9 @@ int main(int argc, char **argv) {
else
setNetworkOption(FDBNetworkOptions::TRACE_ENABLE, StringRef(opt.traceDir));
if (!opt.traceFormat.empty()) {
setNetworkOption(FDBNetworkOptions::TRACE_FORMAT, StringRef(opt.traceFormat));
}
setNetworkOption(FDBNetworkOptions::ENABLE_SLOW_TASK_PROFILING);
}