summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharlie Swanson <charlie.swanson@mongodb.com>2018-09-18 21:34:15 -0400
committerCharlie Swanson <charlie.swanson@mongodb.com>2018-09-19 18:06:06 -0400
commita147f142e65ead4ee136ff60069cfe95ad6549f3 (patch)
tree4d6a67468018a1746dec026a68cbea8aecf0cf93
parent4917206219237841b61b09a22848a3d1e7733adc (diff)
downloadmongo-a147f142e65ead4ee136ff60069cfe95ad6549f3.tar.gz
SERVER-37218 jsTestLog should accept an object
-rw-r--r--src/mongo/shell/utils.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mongo/shell/utils.js b/src/mongo/shell/utils.js
index 097c7122789..a98de90cdc1 100644
--- a/src/mongo/shell/utils.js
+++ b/src/mongo/shell/utils.js
@@ -328,6 +328,9 @@ setJsTestOption = function(name, value) {
};
jsTestLog = function(msg) {
+ if (typeof msg === "object") {
+ msg = tojson(msg);
+ }
assert.eq(typeof(msg), "string", "Received: " + msg);
const msgs = ["----", ...msg.split("\n"), "----"].map(s => `[jsTest] ${s}`);
print(`\n\n${msgs.join("\n")}\n\n`);