mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 00:31:14 +00:00
print debug output immediately
This helps in the cases when get killed by the ctest timeout.
This commit is contained in:
parent
a1fe478ce7
commit
91831ff701
|
@ -34,6 +34,12 @@ auto execute(string cmd, string log_prefix) -> execute_result
|
||||||
stringstream out;
|
stringstream out;
|
||||||
|
|
||||||
// Log cmd
|
// Log cmd
|
||||||
|
|
||||||
|
// print full line thread-safe
|
||||||
|
stringstream printCmd;
|
||||||
|
printCmd << log_prefix << cmd << endl;
|
||||||
|
cout << printCmd.str() << flush;
|
||||||
|
|
||||||
out << log_prefix << cmd << endl;
|
out << log_prefix << cmd << endl;
|
||||||
|
|
||||||
// Execute command and capture stderr, add log_prefix line by line
|
// Execute command and capture stderr, add log_prefix line by line
|
||||||
|
@ -41,6 +47,11 @@ auto execute(string cmd, string log_prefix) -> execute_result
|
||||||
auto line = string{};
|
auto line = string{};
|
||||||
while (getline(in, line))
|
while (getline(in, line))
|
||||||
{
|
{
|
||||||
|
// print full line thread-safe
|
||||||
|
stringstream printLine;
|
||||||
|
printLine << log_prefix << line << endl;
|
||||||
|
cout << printLine.str() << flush;
|
||||||
|
|
||||||
out << log_prefix << line << endl;
|
out << log_prefix << line << endl;
|
||||||
}
|
}
|
||||||
in.close();
|
in.close();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user