Details
Description
Evergreen logs in the CppSuite appear out of sync with the logged time by the CppSuite logger. While not really an issue it can make things a bit confusing when viewing CppSuite logs in evergreen. This is happening as we're not flushing when calling std::cout in the Logger component. We call std::endl but it is contained within the ostringstream which drops the std::flush.
This is a relatively easy fix:
test/cppsuite/src/common/logger.cpp
|
|
diff --git a/test/cppsuite/src/common/logger.cpp b/test/cppsuite/src/common/logger.cpp
|
index 4bb0e982a..4de314db9 100644
|
--- a/test/cppsuite/src/common/logger.cpp
|
+++ b/test/cppsuite/src/common/logger.cpp
|
@@ -86,13 +86,13 @@ logger::log_msg(int64_t trace_type, const std::string &str)
|
|
std::ostringstream ss;
|
ss << time_buf << "[TID:" << std::this_thread::get_id() << "][" << LOG_LEVELS[trace_type]
|
- << "]: " << str << std::endl;
|
+ << "]: " << str;
|
|
std::lock_guard<std::mutex> lg(_logger_mtx);
|
if (trace_type == LOG_ERROR)
|
- std::cerr << ss.str();
|
+ std::cerr << ss.str() << std::endl;
|
else
|
- std::cout << ss.str();
|
+ std::cout << ss.str() << std::endl;
|
}
|
}
|
} // namespace test_harness
|
See: EVG-18114 for more details.
Attachments
Issue Links
- is related to
-
EVG-18114 Evergreen log lines are very far apart from actual log times.
-
- Closed
-