diff options
author | Henrik Edin <henrik.edin@mongodb.com> | 2020-01-21 20:23:50 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2020-01-21 20:23:50 +0000 |
commit | b7846ff4dceec36e344b0f87c48783dffa2c6a32 (patch) | |
tree | 73068bb126bf19901e75bb972a941f17c9759754 /src/mongo/unittest/unittest.h | |
parent | 41b3d7da7c763e304bc8f4056d0d31d200742e0b (diff) | |
download | mongo-b7846ff4dceec36e344b0f87c48783dffa2c6a32.tar.gz |
SERVER-45583 Unittests are using logv2.
Capture log system uses logv2, tests can handle converted log statements.
Diffstat (limited to 'src/mongo/unittest/unittest.h')
-rw-r--r-- | src/mongo/unittest/unittest.h | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/mongo/unittest/unittest.h b/src/mongo/unittest/unittest.h index ebd63872978..30ff41a6971 100644 --- a/src/mongo/unittest/unittest.h +++ b/src/mongo/unittest/unittest.h @@ -569,19 +569,17 @@ protected: * Gets a vector of strings, one log line per string, captured since * the last call to startCapturingLogMessages() in this test. */ - const std::vector<std::string>& getCapturedLogMessages() const { - return _capturedLogMessages; - } + const std::vector<std::string>& getCapturedTextFormatLogMessages() const; /** * Returns the number of collected log lines containing "needle". */ - int64_t countLogLinesContaining(const std::string& needle); + int64_t countTextFormatLogLinesContaining(const std::string& needle); /** * Prints the captured log lines. */ - void printCapturedLogLines() const; + void printCapturedTextFormatLogLines() const; private: /** @@ -589,10 +587,9 @@ private: */ virtual void _doTest() = 0; - bool _isCapturingLogMessages; - std::vector<std::string> _capturedLogMessages; - logger::MessageLogDomain::AppenderHandle _captureAppenderHandle; - std::unique_ptr<logger::MessageLogDomain::EventAppender> _captureAppender; + + class CaptureLogs; + std::unique_ptr<CaptureLogs> _captureLogs; }; /** |