Single Logger implementation for FairLogger & FairMQLogger

This commit is contained in:
Alexey Rybalchenko
2017-10-11 15:49:49 +02:00
committed by Mohammad Al-Turany
parent d3e0b9fc97
commit 4e942e489b
26 changed files with 295 additions and 1287 deletions

View File

@@ -27,7 +27,7 @@ auto RunPoller(string transport, int pollType) -> void
stringstream cmd;
cmd << runTestDevice
<< " --id pollout_"<< transport
<< " --control static --verbosity DEBUG --log-color false"
<< " --control static --severity DEBUG --color false"
<< " --session " << session << " --mq-config \"" << mqConfig << "\"";
pollout = execute(cmd.str(), "[POLLOUT]");
});
@@ -37,7 +37,7 @@ auto RunPoller(string transport, int pollType) -> void
stringstream cmd;
cmd << runTestDevice
<< " --id pollin_" << transport
<< " --control static --verbosity DEBUG --log-color false"
<< " --control static --severity DEBUG --color false"
<< " --session " << session << " --mq-config \"" << mqConfig << "\" --poll-type " << pollType;
pollin = execute(cmd.str(), "[POLLIN]");
});

View File

@@ -25,24 +25,24 @@ auto RunPubSub(string transport) -> void
auto pub = execute_result{"", 0};
thread pub_thread([&]() {
stringstream cmd;
cmd << runTestDevice << " --id pub_" << transport << " --control static --verbosity DEBUG "
<< "--session " << session << " --log-color false --mq-config \"" << mqConfig << "\"";
cmd << runTestDevice << " --id pub_" << transport << " --control static --severity DEBUG "
<< "--session " << session << " --color false --mq-config \"" << mqConfig << "\"";
pub = execute(cmd.str(), "[PUB]");
});
auto sub1 = execute_result{"", 0};
thread sub1_thread([&]() {
stringstream cmd;
cmd << runTestDevice << " --id sub_1" << transport << " --control static --verbosity DEBUG "
<< "--session " << session << " --log-color false --mq-config \"" << mqConfig << "\"";
cmd << runTestDevice << " --id sub_1" << transport << " --control static --severity DEBUG "
<< "--session " << session << " --color false --mq-config \"" << mqConfig << "\"";
sub1 = execute(cmd.str(), "[SUB1]");
});
auto sub2 = execute_result{"", 0};
thread sub2_thread([&]() {
stringstream cmd;
cmd << runTestDevice << " --id sub_2" << transport << " --control static --verbosity DEBUG "
<< "--session " << session << " --log-color false --mq-config \"" << mqConfig << "\"";
cmd << runTestDevice << " --id sub_2" << transport << " --control static --severity DEBUG "
<< "--session " << session << " --color false --mq-config \"" << mqConfig << "\"";
sub2 = execute(cmd.str(), "[SUB2]");
});

View File

@@ -25,16 +25,16 @@ auto RunPushPull(string transport) -> void
auto push = execute_result{"", 100};
thread push_thread([&]() {
stringstream cmd;
cmd << runTestDevice << " --id push_" << transport << " --control static --verbosity DEBUG "
<< "--session " << session << " --log-color false --mq-config \"" << mqConfig << "\"";
cmd << runTestDevice << " --id push_" << transport << " --control static --severity DEBUG "
<< "--session " << session << " --color false --mq-config \"" << mqConfig << "\"";
push = execute(cmd.str(), "[PUSH]");
});
auto pull = execute_result{"", 100};
thread pull_thread([&]() {
stringstream cmd;
cmd << runTestDevice << " --id pull_" << transport << " --control static --verbosity DEBUG "
<< "--session " << session << " --log-color false --mq-config \"" << mqConfig << "\"";
cmd << runTestDevice << " --id pull_" << transport << " --control static --severity DEBUG "
<< "--session " << session << " --color false --mq-config \"" << mqConfig << "\"";
pull = execute(cmd.str(), "[PULL]");
});

View File

@@ -25,24 +25,24 @@ auto RunReqRep(string transport) -> void
auto rep = execute_result{ "", 0 };
thread rep_thread([&]() {
stringstream cmd;
cmd << runTestDevice << " --id rep_" << transport << " --control static --verbosity DEBUG "
<< "--session " << session << " --log-color false --mq-config \"" << mqConfig << "\"";
cmd << runTestDevice << " --id rep_" << transport << " --control static --severity DEBUG "
<< "--session " << session << " --color false --mq-config \"" << mqConfig << "\"";
rep = execute(cmd.str(), "[REP]");
});
auto req1 = execute_result{ "", 0 };
thread req1_thread([&]() {
stringstream cmd;
cmd << runTestDevice << " --id req_1" << transport << " --control static --verbosity DEBUG "
<< "--session " << session << " --log-color false --mq-config \"" << mqConfig << "\"";
cmd << runTestDevice << " --id req_1" << transport << " --control static --severity DEBUG "
<< "--session " << session << " --color false --mq-config \"" << mqConfig << "\"";
req1 = execute(cmd.str(), "[REQ1]");
});
auto req2 = execute_result{ "", 0 };
thread req2_thread([&]() {
stringstream cmd;
cmd << runTestDevice << " --id req_2" << transport << " --control static --verbosity DEBUG "
<< "--session " << session << " --log-color false --mq-config \"" << mqConfig << "\"";
cmd << runTestDevice << " --id req_2" << transport << " --control static --severity DEBUG "
<< "--session " << session << " --color false --mq-config \"" << mqConfig << "\"";
req2 = execute(cmd.str(), "[REQ2]");
});

View File

@@ -21,8 +21,8 @@ auto RunTransferTimeout(string transport) -> void
{
size_t session{fair::mq::tools::UuidHash()};
stringstream cmd;
cmd << runTestDevice << " --id transfer_timeout_" << transport << " --control static --verbosity DEBUG "
<< "--session " << session << " --log-color false --mq-config \"" << mqConfig << "\"";
cmd << runTestDevice << " --id transfer_timeout_" << transport << " --control static --severity DEBUG "
<< "--session " << session << " --color false --mq-config \"" << mqConfig << "\"";
auto res = execute(cmd.str());
cerr << res.error_out;

View File

@@ -40,7 +40,7 @@ auto execute(string cmd, string log_prefix) -> execute_result
out << log_prefix << cmd << endl;
// Execute command and capture stderr, add log_prefix line by line
redi::ipstream in(cmd, redi::pstreams::pstderr);
redi::ipstream in(cmd, redi::pstreams::pstdout);
auto line = string{};
while (getline(in, line))
{