summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenrik Edin <henrik.edin@mongodb.com>2020-02-19 09:18:30 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-02-19 23:46:35 +0000
commit40296a983c2ace467788ea931229aa9d91311cd1 (patch)
tree7f4b1c4136d309c159f7c416506c4e42df085e7d
parent3e8b3ef099e6cfaeecae4e8fa1c8b5662d9bdaed (diff)
downloadmongo-40296a983c2ace467788ea931229aa9d91311cd1.tar.gz
SERVER-45138 Fix logv2 text builder
-rw-r--r--jstests/libs/logv2_helpers.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/jstests/libs/logv2_helpers.js b/jstests/libs/logv2_helpers.js
index 2a322d7f641..a521c145b2c 100644
--- a/jstests/libs/logv2_helpers.js
+++ b/jstests/libs/logv2_helpers.js
@@ -3,7 +3,8 @@
function isJsonLogNoConn() {
const textDefault =
getBuildInfo().buildEnvironment.cppdefines.indexOf("MONGO_CONFIG_TEXT_LOG_DEFAULT") >= 0;
- if (typeof TestData !== 'undefined' && typeof TestData.logFormat !== 'undefined') {
+ if (typeof TestData !== 'undefined' && typeof TestData.logFormat !== 'undefined' &&
+ TestData["logFormat"] != "") {
return TestData["logFormat"] != "text" || (textDefault && TestData["logFormat"] == "json");
}
@@ -13,14 +14,15 @@ function isJsonLogNoConn() {
function isJsonLog(conn) {
const textDefault =
getBuildInfo().buildEnvironment.cppdefines.indexOf("MONGO_CONFIG_TEXT_LOG_DEFAULT") >= 0;
-
- if (typeof TestData !== 'undefined' && typeof TestData.logFormat !== 'undefined') {
+ if (typeof TestData !== 'undefined' && typeof TestData.logFormat !== 'undefined' &&
+ TestData["logFormat"] != "") {
return TestData["logFormat"] != "text" || (textDefault && TestData["logFormat"] == "json");
}
const opts = assert.commandWorked(conn.getDB("admin").runCommand({"getCmdLineOpts": 1}));
const parsed = opts["parsed"];
- if (parsed.hasOwnProperty("systemLog") && parsed["systemLog"].hasOwnProperty("logFormat")) {
+ if (parsed.hasOwnProperty("systemLog") && parsed["systemLog"].hasOwnProperty("logFormat") &&
+ parsed["systemLog"]["logFormat"] != "") {
return parsed["systemLog"]["logFormat"] != "text" ||
(textDefault && parsed["systemLog"]["logFormat"] == "json");
}