Improve log messages
This commit is contained in:
parent
17ab860c8b
commit
6b274ccc88
|
@ -231,7 +231,7 @@ template <typename... ChildArgs> void BuildProcessSession::launch(ChildArgs &&..
|
||||||
[session = shared_from_this()](auto &executor) {
|
[session = shared_from_this()](auto &executor) {
|
||||||
if (const auto buildAction = session->m_buildAction.lock()) {
|
if (const auto buildAction = session->m_buildAction.lock()) {
|
||||||
buildAction->appendOutput(
|
buildAction->appendOutput(
|
||||||
CppUtilities::EscapeCodes::Phrases::InfoMessage, session->m_displayName, " PID: ", executor.pid, '\n');
|
CppUtilities::EscapeCodes::Phrases::InfoMessage, "Launched \"", session->m_displayName, "\", PID: ", executor.pid, '\n');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
boost::process::on_exit =
|
boost::process::on_exit =
|
||||||
|
|
|
@ -52,7 +52,7 @@ ThreadPool::ThreadPool(const char *name, boost::asio::io_context &ioContext, uns
|
||||||
for (auto i = threadCount; i > 0; --i) {
|
for (auto i = threadCount; i > 0; --i) {
|
||||||
threads.emplace_back([&ioContext, name] {
|
threads.emplace_back([&ioContext, name] {
|
||||||
ioContext.run();
|
ioContext.run();
|
||||||
std::cout << Phrases::SubMessage << name << " terminates" << Phrases::End;
|
std::cout << argsToString(formattedPhraseString(Phrases::SubMessage), name, " terminates", formattedPhraseString(Phrases::End));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -263,7 +263,7 @@ void BuildActionsTests::testBuildActionProcess()
|
||||||
CPPUNIT_ASSERT_EQUAL(5001_st, logLines.size());
|
CPPUNIT_ASSERT_EQUAL(5001_st, logLines.size());
|
||||||
CPPUNIT_ASSERT_EQUAL("printing some numbers"s, logLines.front());
|
CPPUNIT_ASSERT_EQUAL("printing some numbers"s, logLines.front());
|
||||||
CPPUNIT_ASSERT_EQUAL("line 5000"s, logLines.back());
|
CPPUNIT_ASSERT_EQUAL("line 5000"s, logLines.back());
|
||||||
TESTUTILS_ASSERT_LIKE_FLAGS("PID logged", ".*test PID\\: [0-9]+.*\n.*"s, std::regex::extended, m_buildAction->output);
|
TESTUTILS_ASSERT_LIKE_FLAGS("PID logged", ".*Launched \"test\", PID\\: [0-9]+.*\n.*"s, std::regex::extended, m_buildAction->output);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
|
@ -119,7 +119,8 @@ void Server::accept()
|
||||||
void Server::handleAccepted(boost::system::error_code ec)
|
void Server::handleAccepted(boost::system::error_code ec)
|
||||||
{
|
{
|
||||||
if (ec) {
|
if (ec) {
|
||||||
cerr << Phrases::WarningMessage << "Failed to accept new connection: " << ec.message() << Phrases::EndFlush;
|
cerr << argsToString(
|
||||||
|
formattedPhraseString(Phrases::WarningMessage), "Failed to accept new connection: ", ec.message(), formattedPhraseString(Phrases::End));
|
||||||
} else {
|
} else {
|
||||||
// create session and run it
|
// create session and run it
|
||||||
std::make_shared<Session>(move(m_socket), m_setup)->receive();
|
std::make_shared<Session>(move(m_socket), m_setup)->receive();
|
||||||
|
|
Loading…
Reference in New Issue