diff options
author | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2020-02-27 22:54:30 -0500 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-02-28 04:14:38 +0000 |
commit | ae7506fb3ec763097208a1fec9228e09e430505a (patch) | |
tree | c273fbfd897a29763ddde8700ef7ff65996cad15 /src/mongo/logger | |
parent | 8dcbfee04b9a5ae83bf0b177a45d3f3e204a4ecb (diff) | |
download | mongo-ae7506fb3ec763097208a1fec9228e09e430505a.tar.gz |
SERVER-46404 Remove shouldLog from logger V1 API
Diffstat (limited to 'src/mongo/logger')
-rw-r--r-- | src/mongo/logger/log_component_settings_test.cpp | 2 | ||||
-rw-r--r-- | src/mongo/logger/log_function_test.cpp | 16 | ||||
-rw-r--r-- | src/mongo/logger/log_test.cpp | 24 |
3 files changed, 21 insertions, 21 deletions
diff --git a/src/mongo/logger/log_component_settings_test.cpp b/src/mongo/logger/log_component_settings_test.cpp index d1b02379752..38b1cf8274d 100644 --- a/src/mongo/logger/log_component_settings_test.cpp +++ b/src/mongo/logger/log_component_settings_test.cpp @@ -54,7 +54,7 @@ TEST(SERVER25981Test, SetSeverityShouldLogAndClear) { stdx::thread shouldLogThread([&]() { startupBarrier.countDownAndWait(); while (running.load()) { - shouldLog(LogComponent::kDefault, logger::LogSeverity::Debug(3)); + shouldLogV1(LogComponent::kDefault, logger::LogSeverity::Debug(3)); } }); diff --git a/src/mongo/logger/log_function_test.cpp b/src/mongo/logger/log_function_test.cpp index 72b3a78d3db..d2acdba4e4f 100644 --- a/src/mongo/logger/log_function_test.cpp +++ b/src/mongo/logger/log_function_test.cpp @@ -65,7 +65,7 @@ const LogComponent componentB = MONGO_LOG_DEFAULT_COMPONENT; TEST_F(LogTestDetailsEncoder, LogFunctionsOverrideGlobalComponent) { // severe() - no component specified. severe() << "This is logged"; - ASSERT_TRUE(shouldLog(LogSeverity::Severe())); + ASSERT_TRUE(shouldLogV1(LogSeverity::Severe())); ASSERT_EQUALS(1U, _logLines.size()); ASSERT_NOT_EQUALS(_logLines[0].find(str::stream() << " F " << componentB.getNameForLog()), std::string::npos); @@ -73,7 +73,7 @@ TEST_F(LogTestDetailsEncoder, LogFunctionsOverrideGlobalComponent) { // severe() - with component. _logLines.clear(); severe(componentA) << "This is logged"; - ASSERT_TRUE(shouldLog(componentA, LogSeverity::Severe())); + ASSERT_TRUE(shouldLogV1(componentA, LogSeverity::Severe())); ASSERT_EQUALS(1U, _logLines.size()); ASSERT_NOT_EQUALS(_logLines[0].find(str::stream() << " F " << componentA.getNameForLog()), std::string::npos); @@ -81,7 +81,7 @@ TEST_F(LogTestDetailsEncoder, LogFunctionsOverrideGlobalComponent) { // error() - no component specified. _logLines.clear(); error() << "This is logged"; - ASSERT_TRUE(shouldLog(LogSeverity::Error())); + ASSERT_TRUE(shouldLogV1(LogSeverity::Error())); ASSERT_EQUALS(1U, _logLines.size()); ASSERT_NOT_EQUALS(_logLines[0].find(str::stream() << " E " << componentB.getNameForLog()), std::string::npos); @@ -89,7 +89,7 @@ TEST_F(LogTestDetailsEncoder, LogFunctionsOverrideGlobalComponent) { // error() - with component. _logLines.clear(); error(componentA) << "This is logged"; - ASSERT_TRUE(shouldLog(componentA, LogSeverity::Error())); + ASSERT_TRUE(shouldLogV1(componentA, LogSeverity::Error())); ASSERT_EQUALS(1U, _logLines.size()); ASSERT_NOT_EQUALS(_logLines[0].find(str::stream() << " E " << componentA.getNameForLog()), std::string::npos); @@ -97,7 +97,7 @@ TEST_F(LogTestDetailsEncoder, LogFunctionsOverrideGlobalComponent) { // warning() - no component specified. _logLines.clear(); warning() << "This is logged"; - ASSERT_TRUE(shouldLog(LogSeverity::Warning())); + ASSERT_TRUE(shouldLogV1(LogSeverity::Warning())); ASSERT_EQUALS(1U, _logLines.size()); ASSERT_NOT_EQUALS(_logLines[0].find(str::stream() << " W " << componentB.getNameForLog()), std::string::npos); @@ -105,7 +105,7 @@ TEST_F(LogTestDetailsEncoder, LogFunctionsOverrideGlobalComponent) { // warning() - with component. _logLines.clear(); warning(componentA) << "This is logged"; - ASSERT_TRUE(shouldLog(componentA, LogSeverity::Warning())); + ASSERT_TRUE(shouldLogV1(componentA, LogSeverity::Warning())); ASSERT_EQUALS(1U, _logLines.size()); ASSERT_NOT_EQUALS(_logLines[0].find(str::stream() << " W " << componentA.getNameForLog()), std::string::npos); @@ -113,7 +113,7 @@ TEST_F(LogTestDetailsEncoder, LogFunctionsOverrideGlobalComponent) { // log() - no component specified. _logLines.clear(); log() << "This is logged"; - ASSERT_TRUE(shouldLog(LogSeverity::Log())); + ASSERT_TRUE(shouldLogV1(LogSeverity::Log())); ASSERT_EQUALS(1U, _logLines.size()); ASSERT_NOT_EQUALS(_logLines[0].find(str::stream() << " I " << componentB.getNameForLog()), std::string::npos); @@ -121,7 +121,7 @@ TEST_F(LogTestDetailsEncoder, LogFunctionsOverrideGlobalComponent) { // log() - with component. _logLines.clear(); log(componentA) << "This is logged"; - ASSERT_TRUE(shouldLog(componentA, LogSeverity::Log())); + ASSERT_TRUE(shouldLogV1(componentA, LogSeverity::Log())); ASSERT_EQUALS(1U, _logLines.size()); ASSERT_NOT_EQUALS(_logLines[0].find(str::stream() << " I " << componentA.getNameForLog()), std::string::npos); diff --git a/src/mongo/logger/log_test.cpp b/src/mongo/logger/log_test.cpp index dcb4bb671cb..9ee4e1b6f85 100644 --- a/src/mongo/logger/log_test.cpp +++ b/src/mongo/logger/log_test.cpp @@ -215,10 +215,10 @@ TEST_F(LogTestUnadornedEncoder, LogComponentSettingsShouldLogDefaultLogComponent LogComponentSettings settings; // Initial log severity for LogComponent::kDefault is Log(). - ASSERT_TRUE(shouldLog(LogSeverity::Info())); - ASSERT_TRUE(shouldLog(LogSeverity::Log())); - ASSERT_FALSE(shouldLog(LogSeverity::Debug(1))); - ASSERT_FALSE(shouldLog(LogSeverity::Debug(2))); + ASSERT_TRUE(shouldLogV1(LogSeverity::Info())); + ASSERT_TRUE(shouldLogV1(LogSeverity::Log())); + ASSERT_FALSE(shouldLogV1(LogSeverity::Debug(1))); + ASSERT_FALSE(shouldLogV1(LogSeverity::Debug(2))); // If any components are provided to shouldLog(), we should get the same outcome // because we have not configured any non-LogComponent::kDefault components. @@ -229,10 +229,10 @@ TEST_F(LogTestUnadornedEncoder, LogComponentSettingsShouldLogDefaultLogComponent settings.setMinimumLoggedSeverity(LogComponent::kDefault, LogSeverity::Debug(1)); setMinimumLoggedSeverity(LogComponent::kDefault, LogSeverity::Debug(1)); - ASSERT_TRUE(shouldLog(LogSeverity::Info())); - ASSERT_TRUE(shouldLog(LogSeverity::Log())); - ASSERT_TRUE(shouldLog(LogSeverity::Debug(1))); - ASSERT_FALSE(shouldLog(LogSeverity::Debug(2))); + ASSERT_TRUE(shouldLogV1(LogSeverity::Info())); + ASSERT_TRUE(shouldLogV1(LogSeverity::Log())); + ASSERT_TRUE(shouldLogV1(LogSeverity::Debug(1))); + ASSERT_FALSE(shouldLogV1(LogSeverity::Debug(2))); // Revert back. setMinimumLoggedSeverity(LogComponent::kDefault, LogSeverity::Log()); @@ -267,8 +267,8 @@ TEST_F(LogTestUnadornedEncoder, LogComponentSettingsShouldLogSingleComponent) { setMinimumLoggedSeverity(LogComponent::kDefault, LogSeverity::Debug(1)); // Components for log message: LogComponent::kDefault only. - ASSERT_TRUE(shouldLog(LogSeverity::Debug(1))); - ASSERT_FALSE(shouldLog(LogSeverity::Debug(2))); + ASSERT_TRUE(shouldLogV1(LogSeverity::Debug(1))); + ASSERT_FALSE(shouldLogV1(LogSeverity::Debug(2))); setMinimumLoggedSeverity(LogComponent::kDefault, LogSeverity::Log()); } @@ -304,8 +304,8 @@ TEST_F(LogTestUnadornedEncoder, LogComponentSettingsShouldLogMultipleComponentsC // Components for log message: LogComponent::kDefault only. - ASSERT_TRUE(shouldLog(LogSeverity::Debug(1))); - ASSERT_FALSE(shouldLog(LogSeverity::Debug(2))); + ASSERT_TRUE(shouldLogV1(LogSeverity::Debug(1))); + ASSERT_FALSE(shouldLogV1(LogSeverity::Debug(2))); setMinimumLoggedSeverity(LogComponent::kDefault, LogSeverity::Log()); } |