diff options
author | Billy Donahue <billy.donahue@mongodb.com> | 2020-04-25 12:23:19 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-05-03 20:01:47 +0000 |
commit | d5bfe99ef95ba205192db36db14a7e46592094dc (patch) | |
tree | 0880ff58ec0e385b33a3f2a45c5db054e63174bb /src/mongo/dbtests | |
parent | c7220a8080388da758230240a94ca0a15156148b (diff) | |
download | mongo-d5bfe99ef95ba205192db36db14a7e46592094dc.tar.gz |
SERVER-47735 change mongo source over to logv2
- Remove several legacy logger/ files
- Convert all MONGO_LOG_DEFAULT_COMPONENT to the LOGV2 version.
- Globally replace logger::{LogSeverity,LogComponent} => logv2::
(cherry picked from commit eae31861e0f813f0099e1d490c4a622d75cd5a08)
Diffstat (limited to 'src/mongo/dbtests')
-rw-r--r-- | src/mongo/dbtests/framework.cpp | 2 | ||||
-rw-r--r-- | src/mongo/dbtests/jsobjtests.cpp | 2 | ||||
-rw-r--r-- | src/mongo/dbtests/jstests.cpp | 16 | ||||
-rw-r--r-- | src/mongo/dbtests/repltests.cpp | 6 | ||||
-rw-r--r-- | src/mongo/dbtests/threadedtests.cpp | 2 |
5 files changed, 13 insertions, 15 deletions
diff --git a/src/mongo/dbtests/framework.cpp b/src/mongo/dbtests/framework.cpp index d16101b7fc0..ffcb6ee1c5f 100644 --- a/src/mongo/dbtests/framework.cpp +++ b/src/mongo/dbtests/framework.cpp @@ -27,7 +27,7 @@ * it in the license file. */ -#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kDefault +#define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kDefault #include "mongo/platform/basic.h" diff --git a/src/mongo/dbtests/jsobjtests.cpp b/src/mongo/dbtests/jsobjtests.cpp index 091a950c1bb..d7bbac71c8e 100644 --- a/src/mongo/dbtests/jsobjtests.cpp +++ b/src/mongo/dbtests/jsobjtests.cpp @@ -31,7 +31,7 @@ * Tests for jsobj.{h,cpp} code */ -#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kDefault +#define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kDefault #include "mongo/platform/basic.h" diff --git a/src/mongo/dbtests/jstests.cpp b/src/mongo/dbtests/jstests.cpp index 7955260d03d..4244b9bb4dc 100644 --- a/src/mongo/dbtests/jstests.cpp +++ b/src/mongo/dbtests/jstests.cpp @@ -27,7 +27,7 @@ * it in the license file. */ -#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kDefault +#define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kDefault #include "mongo/platform/basic.h" @@ -168,9 +168,7 @@ public: class LogRecordingScope { public: LogRecordingScope() - : _logged(false), - _threadName(mongo::getThreadName().toString()), - _handle(mongo::logger::globalLogDomain()->attachAppender(std::make_unique<Tee>(this))) {} + : _handle(mongo::logger::globalLogDomain()->attachAppender(std::make_unique<Tee>(this))) {} ~LogRecordingScope() { mongo::logger::globalLogDomain()->detachAppender(_handle); } @@ -180,11 +178,10 @@ public: } private: - class Tee : public mongo::logger::MessageLogDomain::EventAppender { + class Tee : public mongo::logger::Appender<mongo::logger::MessageEventEphemeral> { public: Tee(LogRecordingScope* scope) : _scope(scope) {} - virtual ~Tee() {} - virtual Status append(const logger::MessageEventEphemeral& event) { + Status append(const logger::MessageEventEphemeral& event) override { // Don't want to consider logging by background threads. if (mongo::getThreadName() == _scope->_threadName) { _scope->_logged = true; @@ -195,8 +192,9 @@ private: private: LogRecordingScope* _scope; }; - bool _logged; - const string _threadName; + + bool _logged = false; + const string _threadName = mongo::getThreadName().toString(); mongo::logger::MessageLogDomain::AppenderHandle _handle; }; diff --git a/src/mongo/dbtests/repltests.cpp b/src/mongo/dbtests/repltests.cpp index bdb122a7efb..b90fa0ab08e 100644 --- a/src/mongo/dbtests/repltests.cpp +++ b/src/mongo/dbtests/repltests.cpp @@ -27,7 +27,7 @@ * it in the license file. */ -#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kDefault +#define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kDefault #include "mongo/platform/basic.h" @@ -56,8 +56,8 @@ using namespace mongo::repl; namespace ReplTests { using mongo::logger::globalLogDomain; -using mongo::logger::LogComponent; -using mongo::logger::LogSeverity; +using mongo::logv2::LogComponent; +using mongo::logv2::LogSeverity; using std::endl; using std::string; using std::stringstream; diff --git a/src/mongo/dbtests/threadedtests.cpp b/src/mongo/dbtests/threadedtests.cpp index 6afeb2283a9..27cdfc95df7 100644 --- a/src/mongo/dbtests/threadedtests.cpp +++ b/src/mongo/dbtests/threadedtests.cpp @@ -27,7 +27,7 @@ * it in the license file. */ -#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kCommand +#define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kCommand #include "mongo/platform/basic.h" |