Verbose: Print these messages only in verbose mode

This commit is contained in:
2025-09-09 12:02:03 -04:00
parent 576d3ed7a5
commit 8413277847
2 changed files with 19 additions and 5 deletions
+12 -2
View File
@@ -3,6 +3,7 @@
#include <pthread.h>
#include <sched.h>
#include <boost/asio.hpp>
#include <opts.h>
#include <mind.h>
#include <componentThread.h>
#include <marionette/marionette.h>
@@ -39,7 +40,13 @@ const std::shared_ptr<ComponentThread> ComponentThread::getSelf(void)
void ComponentThread::main(ComponentThread& self)
{
std::cout << self.name << ":" << __func__ << ": Waiting for JOLT" <<"\n";
if (OptionParser::getOptions().verbose)
{
std::cout << self.name << ":" << __func__ << ": Waiting for JOLT"
<<"\n";
}
self.getIoService().run();
self.initializeTls();
@@ -304,7 +311,10 @@ void ComponentThread::pinToCpu(int cpuId)
}
pinnedCpuId = cpuId;
std::cout << name << ": Pinned to CPU " << cpuId << "\n";
if (OptionParser::getOptions().verbose)
{
std::cout << name << ": Pinned to CPU " << cpuId << "\n";
}
}
} // namespace smo
+7 -3
View File
@@ -1,4 +1,5 @@
#include <iostream>
#include <opts.h>
#include <mind.h>
#include <componentThread.h>
@@ -143,7 +144,10 @@ Mind::getMindThreads() const
void Mind::distributeAndPinThreadsAcrossCpus()
{
int cpuCount = ComponentThread::getAvailableCpuCount();
std::cout << "Available CPUs: " << cpuCount << "\n";
if (OptionParser::getOptions().verbose) {
std::cout << __func__ << ": Available CPUs: " << cpuCount << "\n";
}
// Distribute and pin threads across CPUs
int threadIndex = 0;
@@ -154,8 +158,8 @@ void Mind::distributeAndPinThreadsAcrossCpus()
++threadIndex;
}
std::cout << "Distributed " << threadIndex << " threads across "
<< cpuCount << " CPUs\n";
std::cout << __func__ << ": Distributed " << threadIndex << " threads "
<< "across " << cpuCount << " CPUs\n";
}
// Thread management methods (moved from ComponentThread)