summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Cooper <adam.cooper@mongodb.com>2020-09-08 13:31:59 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-09-08 19:36:37 +0000
commit277782e54a6ccd4dc783b53d5dface21ebaed938 (patch)
tree13e2562a4cfd844f9074885371a65ef44e08f306
parentc1808dd194575ea7a49893e782df50fe29c00bd1 (diff)
downloadmongo-277782e54a6ccd4dc783b53d5dface21ebaed938.tar.gz
SERVER-6777 Eliminate all direct use of cout/stdout and cerr/stderr
-rw-r--r--src/mongo/util/processinfo_linux.cpp2
-rw-r--r--src/mongo/util/processinfo_osx.cpp10
-rw-r--r--src/mongo/util/processinfo_windows.cpp8
3 files changed, 11 insertions, 9 deletions
diff --git a/src/mongo/util/processinfo_linux.cpp b/src/mongo/util/processinfo_linux.cpp
index a968c54727f..78c38ec996f 100644
--- a/src/mongo/util/processinfo_linux.cpp
+++ b/src/mongo/util/processinfo_linux.cpp
@@ -135,7 +135,7 @@ public:
*/
);
if (found == 0) {
- std::cout << "system error: reading proc info" << std::endl;
+ LOGV2(677701, "system error: reading proc info");
}
fclose(f);
}
diff --git a/src/mongo/util/processinfo_osx.cpp b/src/mongo/util/processinfo_osx.cpp
index 0aad3fd83fa..aab2f4e3fd7 100644
--- a/src/mongo/util/processinfo_osx.cpp
+++ b/src/mongo/util/processinfo_osx.cpp
@@ -75,7 +75,7 @@ int ProcessInfo::getVirtualMemorySize() {
mach_port_t task;
if ((result = task_for_pid(mach_task_self(), _pid.toNative(), &task)) != KERN_SUCCESS) {
- std::cout << "error getting task\n";
+ LOGV2(677702, "error getting task");
return 0;
}
@@ -86,7 +86,7 @@ int ProcessInfo::getVirtualMemorySize() {
#endif
mach_msg_type_number_t count = TASK_BASIC_INFO_COUNT;
if ((result = task_info(task, TASK_BASIC_INFO, (task_info_t)&ti, &count)) != KERN_SUCCESS) {
- std::cout << "error getting task_info: " << result << std::endl;
+ LOGV2(677703, "error getting task_info", "result"_attr = result);
return 0;
}
return (int)((double)ti.virtual_size / (1024.0 * 1024));
@@ -98,7 +98,7 @@ int ProcessInfo::getResidentSize() {
mach_port_t task;
if ((result = task_for_pid(mach_task_self(), _pid.toNative(), &task)) != KERN_SUCCESS) {
- std::cout << "error getting task\n";
+ LOGV2(577704, "error getting task");
return 0;
}
@@ -110,7 +110,7 @@ int ProcessInfo::getResidentSize() {
#endif
mach_msg_type_number_t count = TASK_BASIC_INFO_COUNT;
if ((result = task_info(task, TASK_BASIC_INFO, (task_info_t)&ti, &count)) != KERN_SUCCESS) {
- std::cout << "error getting task_info: " << result << std::endl;
+ LOGV2(677705, "error getting task_info", "result"_attr = result);
return 0;
}
return (int)(ti.resident_size / (1024 * 1024));
@@ -126,7 +126,7 @@ void ProcessInfo::getExtraInfo(BSONObjBuilder& info) {
if (KERN_SUCCESS !=
task_info(mach_task_self(), TASK_EVENTS_INFO, (integer_t*)&taskInfo, &taskInfoCount)) {
- std::cout << "error getting extra task_info" << std::endl;
+ LOGV2(677706, "error getting extra task_info");
return;
}
diff --git a/src/mongo/util/processinfo_windows.cpp b/src/mongo/util/processinfo_windows.cpp
index aeff1ba1ae9..31c0908fb32 100644
--- a/src/mongo/util/processinfo_windows.cpp
+++ b/src/mongo/util/processinfo_windows.cpp
@@ -367,9 +367,11 @@ bool ProcessInfo::blockInMemory(const void* start) {
if (bstat) {
for (int i=0; i<30; i++) {
if (wiex[i].BasicInfo.FaultingPc == 0) break;
- cout << "faulting pc = " << wiex[i].BasicInfo.FaultingPc <<
- " address = " << wiex[i].BasicInfo.FaultingVa <<
- " thread id = " << wiex[i].FaultingThreadId << endl;
+ LOGV2(677707,
+ "Encountered a page fault",
+ "faulting_pc"_attr = wiex[i].BasicInfo.FaultingPcm,
+ "address"_attr = wiex[i].BasicInfo.FaultingVa,
+ "thread_id"_attr = wiex[i].FaultingThreadId);
}
}
#endif