diff options
| author | trahman1318 <tausif.rahman@mongodb.com> | 2022-01-24 20:51:15 +0000 |
|---|---|---|
| committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-01-24 22:02:03 +0000 |
| commit | ac8581ed35cb4d1dd20d4ac034bce6a2be868916 (patch) | |
| tree | cc5543baa1f3b7bd9f97bc27a47b123cf7038966 | |
| parent | 2d23c2650eee84f5bcbb9bef5acdad4a583d488b (diff) | |
| download | mongo-ac8581ed35cb4d1dd20d4ac034bce6a2be868916.tar.gz | |
SERVER-62927 Add disablePrint & enablePrint functions to mongo shell
| -rw-r--r-- | src/mongo/shell/utils.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mongo/shell/utils.js b/src/mongo/shell/utils.js index ec5e7b92305..abfe6cce8de 100644 --- a/src/mongo/shell/utils.js +++ b/src/mongo/shell/utils.js @@ -194,6 +194,15 @@ shellPrint = function(x) { shellPrintHelper(x); }; +_originalPrint = print; +disablePrint = function() { + print = Function.prototype; +}; + +enablePrint = function() { + print = _originalPrint; +}; + print.captureAllOutput = function(fn, args) { var res = {}; res.output = []; |
