Improve log messages

This commit is contained in:
Martchus 2021-01-26 19:30:58 +01:00
parent 17ab860c8b
commit 6b274ccc88
4 changed files with 5 additions and 4 deletions

View File

@ -231,7 +231,7 @@ template <typename... ChildArgs> void BuildProcessSession::launch(ChildArgs &&..
[session = shared_from_this()](auto &executor) {
if (const auto buildAction = session->m_buildAction.lock()) {
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 =

View File

@ -52,7 +52,7 @@ ThreadPool::ThreadPool(const char *name, boost::asio::io_context &ioContext, uns
for (auto i = threadCount; i > 0; --i) {
threads.emplace_back([&ioContext, name] {
ioContext.run();
std::cout << Phrases::SubMessage << name << " terminates" << Phrases::End;
std::cout << argsToString(formattedPhraseString(Phrases::SubMessage), name, " terminates", formattedPhraseString(Phrases::End));
});
}
}

View File

@ -263,7 +263,7 @@ void BuildActionsTests::testBuildActionProcess()
CPPUNIT_ASSERT_EQUAL(5001_st, logLines.size());
CPPUNIT_ASSERT_EQUAL("printing some numbers"s, logLines.front());
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);
}
/*!

View File

@ -119,7 +119,8 @@ void Server::accept()
void Server::handleAccepted(boost::system::error_code 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 {
// create session and run it
std::make_shared<Session>(move(m_socket), m_setup)->receive();