From a29cb7d084afa62772776fc2b58efb1df91c535f Mon Sep 17 00:00:00 2001 From: Gabriel Russell Date: Mon, 25 Nov 2019 22:16:49 +0000 Subject: SERVER-44142 correctly utilize LogSeverity in logv2 --- src/mongo/shell/dbshell.cpp | 2 +- src/mongo/shell/shell_options.cpp | 4 ++-- src/mongo/shell/shell_options.h | 2 -- 3 files changed, 3 insertions(+), 5 deletions(-) (limited to 'src/mongo/shell') diff --git a/src/mongo/shell/dbshell.cpp b/src/mongo/shell/dbshell.cpp index eca95ae9f92..3e59edfbfb1 100644 --- a/src/mongo/shell/dbshell.cpp +++ b/src/mongo/shell/dbshell.cpp @@ -749,7 +749,7 @@ int _main(int argc, char* argv[], char** envp) { if (!mongo::serverGlobalParams.quiet.load()) std::cout << mongoShellVersion(VersionInfoInterface::instance()) << std::endl; - if (!shellGlobalParams.logV2) { + if (!logV2Enabled()) { logger::globalLogManager() ->getNamedDomain("javascriptOutput") ->attachAppender(std::make_unique( diff --git a/src/mongo/shell/shell_options.cpp b/src/mongo/shell/shell_options.cpp index 2441ff9ce45..7f0766c3496 100644 --- a/src/mongo/shell/shell_options.cpp +++ b/src/mongo/shell/shell_options.cpp @@ -109,7 +109,7 @@ Status storeMongoShellOptions(const moe::Environment& params, } if (params.count("verbose")) { - logger::globalLogDomain()->setMinimumLoggedSeverity(logger::LogSeverity::Debug(1)); + setMinimumLoggedSeverity(logger::LogSeverity::Debug(1)); } // `objcheck` option is part of `serverGlobalParams` to avoid making common parts depend upon @@ -338,7 +338,7 @@ Status storeMongoShellOptions(const moe::Environment& params, } if (params.count("logv2")) { - shellGlobalParams.logV2 = true; + logV2Set(true); } return Status::OK(); diff --git a/src/mongo/shell/shell_options.h b/src/mongo/shell/shell_options.h index 2868998197f..45ac4e55455 100644 --- a/src/mongo/shell/shell_options.h +++ b/src/mongo/shell/shell_options.h @@ -81,8 +81,6 @@ struct ShellGlobalParams { int jsHeapLimitMB = 0; bool nokillop = false; Seconds idleSessionTimeout = Seconds{0}; - - bool logV2 = false; }; extern ShellGlobalParams shellGlobalParams; -- cgit v1.2.1