mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 09:31:45 +00:00
print debug output immediately
This helps in the cases when get killed by the ctest timeout.
This commit is contained in:
committed by
Mohammad Al-Turany
parent
a1fe478ce7
commit
91831ff701
@@ -34,6 +34,12 @@ auto execute(string cmd, string log_prefix) -> execute_result
|
||||
stringstream out;
|
||||
|
||||
// Log cmd
|
||||
|
||||
// print full line thread-safe
|
||||
stringstream printCmd;
|
||||
printCmd << log_prefix << cmd << endl;
|
||||
cout << printCmd.str() << flush;
|
||||
|
||||
out << log_prefix << cmd << endl;
|
||||
|
||||
// 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{};
|
||||
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;
|
||||
}
|
||||
in.close();
|
||||
|
Reference in New Issue
Block a user