diff options
author | Henrik Edin <henrik.edin@mongodb.com> | 2020-02-19 09:18:30 -0500 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-02-19 23:46:35 +0000 |
commit | 40296a983c2ace467788ea931229aa9d91311cd1 (patch) | |
tree | 7f4b1c4136d309c159f7c416506c4e42df085e7d | |
parent | 3e8b3ef099e6cfaeecae4e8fa1c8b5662d9bdaed (diff) | |
download | mongo-40296a983c2ace467788ea931229aa9d91311cd1.tar.gz |
SERVER-45138 Fix logv2 text builder
-rw-r--r-- | jstests/libs/logv2_helpers.js | 10 |
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"); } |